Is it possible to define jetty server in eclipse r

2019-07-28 09:41发布

I have created a REST WS application using eclipse WTP. So far, I was using Tomcat 7 to deploy my application. I could define Tomcat into Server runtime environments. Now i want to use jetty for to deploy that application, I downloaded jetty 8 and I have eclipse Indigo .. tried to define jetty the way i did for Tomcat but it did not work because the available adapter is for jetty6 and when I try to run my application using this adapter, I get a message saying the server does not suport version 3.0 of J2EE Web module specification

How can I run my application on jetty from eclipse?

1条回答
Animai°情兽
2楼-- · 2019-07-28 10:25

jetty 6 supports only jsp/servlets 2.5 specification, so you need to use jetty8 with servlets/jsp 3.0 support

use maven to add jetty 8 like this

<dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-server</artifactId>
        <version>${jetty.revision}</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-webapp</artifactId>
        <version>${jetty.revision}</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-servlet</artifactId>
        <version>${jetty.revision}</version>
    </dependency>

where jetty version is for example this one 8.1.5.v20120716

查看更多
登录 后发表回答