Embeded Jetty with JSP
Simple Jetty server with JSP supported.
public static void main(String[] args) throws Exception {
Server server = new Server(8082);
Configuration.ClassList classlist = Configuration.ClassList.setServerDefault(server);
classlist.addBefore("org.eclipse.jetty.webapp.JettyWebXmlConfiguration",
"org.eclipse.jetty.annotations.AnnotationConfiguration" );
WebAppContext context = new WebAppContext("src/main/webapp", "/");
server.setHandler(context);
server.start();
}pom.xml
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>apache-jsp</artifactId>
<version>9.4.2.v20170220</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-annotations</artifactId>
<version>9.4.2.v20170220</version>
</dependency>
public static void main(String[] args) throws Exception {
Server server = new Server(8082);
Configuration.ClassList classlist = Configuration.ClassList.setServerDefault(server);
classlist.addBefore("org.eclipse.jetty.webapp.JettyWebXmlConfiguration",
"org.eclipse.jetty.annotations.AnnotationConfiguration" );
WebAppContext context = new WebAppContext("src/main/webapp", "/");
server.setHandler(context);
server.start();
}pom.xml
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>apache-jsp</artifactId>
<version>9.4.2.v20170220</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-annotations</artifactId>
<version>9.4.2.v20170220</version>
</dependency>
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。