maven ssm项目用jetty插件运行正常,war放到tomcat就resource is not available?

我把这个项目在idea里clean and install之后war文件放到了tomcat安装目录的webapps目录下,启动tomcat,随便看一个网页就是The requested resource is not available。只有tomcat的主页是能看的。我需要项目在tomcat 7.0.56里正常运行。

jetty配置如下:

    <plugin>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>maven-jetty-plugin</artifactId>
        <version>6.1.25</version>
        <configuration>
            <connectors>
                <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
                    <port>8888</port>
                    <maxIdleTime>60000</maxIdleTime>
                </connector>
            </connectors>
            <contextPath>/ABC</contextPath>
            <scanIntervalSeconds>0</scanIntervalSeconds>
        </configuration>
    </plugin>
    
阅读 3k
2 个回答

1:看看tomcat日志,是不是项目启动报错了。
2:访问的时候,是否没有加应用上下文,比如war为app.war,应用上下文为app, 比如访问index.html页面,则访问地址为ip:8080/app/index.html

谢谢,问题已解决。正确的网址是:http://localhost:8888/项目名-1.0/test.html。
war文件的文件名是项目名-1.0.war,我原来忘记了在网址里加-1.0,就不能用了。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题