Embeded Jetty with JSP

发布时间:2020-08-06 19:00:28 作者:21ca
来源:ITPUB博客 阅读:109
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.       <dependency>
  2.           <groupId>org.eclipse.jetty</groupId>
  3.           <artifactId>apache-jsp</artifactId>
  4.           <version>9.4.2.v20170220</version>
  5.       </dependency>
  6.       <dependency>
  7.           <groupId>org.eclipse.jetty</groupId>
  8.           <artifactId>jetty-annotations</artifactId>
  9.           <version>9.4.2.v20170220</version>
  10.       </dependency>


推荐阅读:
  1. 如何在VUE中为对象添加属性
  2. 使用Java怎么将excel中的数据导入mysql中

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

embeded jsp with

上一篇:sql server 2012数据库镜像

下一篇:SSM框架整合(Spring+SpringMVC+MyBatis)

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》