Java mvn jetty:运行给定错误404
我有一个SpringMVCWeb应用程序,并尝试使用Jetty运行它。但是每当我打字的时候 mvn码头:运行 我得到了在Jetty Server启动时结束的事件的正确序列 但是,当我试图打开浏览器并键入Java mvn jetty:运行给定错误404,java,maven,spring-mvc,jetty,Java,Maven,Spring Mvc,Jetty,我有一个SpringMVCWeb应用程序,并尝试使用Jetty运行它。但是每当我打字的时候 mvn码头:运行 我得到了在Jetty Server启动时结束的事件的正确序列 但是,当我试图打开浏览器并键入 http:localhost:8080/app 我得到错误404页未找到 这是我的pom.xml jetty部分 <plugin> <!-- This plugin is needed for the servlet example --> <groupI
http:localhost:8080/app
我得到错误404页未找到
这是我的pom.xml jetty部分
<plugin>
<!-- This plugin is needed for the servlet example -->
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>7.2.0.v20101020</version>
<configuration>
<webApp>
<contextPath>/app</contextPath>
</webApp>
</configuration>
</plugin>
我的控制器映射到@RequestMapping/,我的servlet也映射到/。xml构建名称为app,因此URL为http://localhost:8080/app
这方面的任何帮助都会很好。
我也试过Jetty v9,但也不起作用
编辑
因此,只需尝试访问url即可http://localhost:8080/app/index.jsp 如果web内容文件夹下必须有index.jsp,请尝试此方法,效果很好
编辑
因此,只需尝试访问url即可http://localhost:8080/app/index.jsp web内容文件夹下必须有index.jsp,抱歉,我没有说我也尝试了,但它仍然给我相同的错误404。我现在对问题进行了编辑,以反映这一点。ThanksThanks@SparkOn我试过了,但仍然得到了相同的错误:您是否尝试使用此url http:localhost:8080/appyes,我在使用该url时得到了相同的请求URI Notfound错误:首先,http:localhost:8080/app是错误的,应该是错误的http://localhost:8080/app 如果你给出了这个url,那么你必须有一个可以在web.xml中指定的登录页。很抱歉,我没有说我也尝试了,但它仍然给了我相同的错误404。我现在对问题进行了编辑,以反映这一点。ThanksThanks@SparkOn我试过了,但仍然得到了相同的错误:您是否尝试使用此url http:localhost:8080/appyes,我在使用该url时得到了相同的请求URI Notfound错误:首先,http:localhost:8080/app是错误的,应该是错误的http://localhost:8080/app 如果您提供这个url,那么您必须有一个可以在web.xml中指定的登录页
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.8</version>
<configuration>
<contextPath>/app</contextPath>
</configuration>
</plugin>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>