Is it possible to define jetty server in eclipse runtime environment?

自闭症网瘾萝莉.ら 提交于 2019-12-11 10:36:47

问题


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:


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



来源:https://stackoverflow.com/questions/11691036/is-it-possible-to-define-jetty-server-in-eclipse-runtime-environment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!