comparison src/global/GlobalJetty.java @ 0:7ecd1a4ef557

add content
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 21 Mar 2019 19:15:52 -0600
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:7ecd1a4ef557
1 package global;
2
3 import nabble.view.lib.JtpContextServlet;
4 import nabble.utils.Jetty;
5 import org.eclipse.jetty.servlet.ServletContextHandler;
6 import org.eclipse.jetty.servlet.ServletHolder;
7 import nabble.utils.LuanServlet;
8
9 import java.net.MalformedURLException;
10
11 public class GlobalJetty extends Jetty {
12
13 public ServletContextHandler newWebContext()
14 throws MalformedURLException
15 {
16 ServletContextHandler context = newContext("/", "global/web/Index.class");
17
18 newServletHolder( new LuanServlet("classpath:global/web"), context, new String[]{"*.luan"} );
19
20 JtpContextServlet jtpContext = new JtpContextServlet();
21 jtpContext.setBase("global.web");
22 jtpContext.setUrlMapper( UrlMapperImpl.INSTANCE );
23 jtpContext.setHttpCache( WebCache.INSTANCE );
24
25 ServletHolder sh = newServletHolder(jtpContext, context, new String[] { "/", "*.jtp" });
26 sh.setInitParameter("cache","false");
27 addDefaultServlet(context);
28
29 return context;
30 }
31
32 }