鍍金池/ 問答/Java  C  Linux  網(wǎng)絡(luò)安全/ maven ssm項(xiàng)目用jetty插件運(yùn)行正常,war放到tomcat就reso

maven ssm項(xiàng)目用jetty插件運(yùn)行正常,war放到tomcat就resource is not available?

我把這個(gè)項(xiàng)目在idea里clean and install之后war文件放到了tomcat安裝目錄的webapps目錄下,啟動(dòng)tomcat,隨便看一個(gè)網(wǎng)頁(yè)就是The requested resource is not available。只有tomcat的主頁(yè)是能看的。我需要項(xiàng)目在tomcat 7.0.56里正常運(yùn)行。

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>
    
回答
編輯回答
墨小白

1:看看tomcat日志,是不是項(xiàng)目啟動(dòng)報(bào)錯(cuò)了。
2:訪問的時(shí)候,是否沒有加應(yīng)用上下文,比如war為app.war,應(yīng)用上下文為app, 比如訪問index.html頁(yè)面,則訪問地址為ip:8080/app/index.html

2018年5月18日 11:15
編輯回答
短嘆

謝謝,問題已解決。正確的網(wǎng)址是:http://localhost:8888/項(xiàng)目名-1.0/test.html。
war文件的文件名是項(xiàng)目名-1.0.war,我原來忘記了在網(wǎng)址里加-1.0,就不能用了。

2017年5月29日 17:51