成都网站建设设计

将想法与焦点和您一起共享

EmbededJettywithJSP

Simple Jetty server with JSP supported.
  1.     public static void main(String[] args) throws Exception {
  2.         Server server = new Server(8082);

  3.         Configuration.ClassList classlist = Configuration.ClassList.setServerDefault(server);
  4.         classlist.addBefore("org.eclipse.jetty.webapp.JettyWebXmlConfiguration",
  5.                 "org.eclipse.jetty.annotations.AnnotationConfiguration" );

  6.         WebAppContext context = new WebAppContext("src/main/webapp", "/");
  7.         server.setHandler(context);
  8.         server.start();
  9.     }
pom.xml
  1.      
  2.           org.eclipse.jetty
  3.           apache-jsp
  4.           9.4.2.v20170220
  5.       
  6.       
  7.           org.eclipse.jetty
  8.           jetty-annotations
  9.           9.4.2.v20170220
  10.       



当前题目:EmbededJettywithJSP
标题网址:http://chengdu.cdxwcx.cn/article/jhddos.html