0
|
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 }
|