為啥是404?
問題一 項(xiàng)目jsp會(huì)報(bào)錯(cuò) The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
解決辦法:web工程-》屬性或Build Path-》Java Build Path->Libraries-> Add Libray...->Server Runtime -》Apache tomcat ?7.0 -》finish
問題二 有兩個(gè)包需要加,不然會(huì)報(bào)錯(cuò)。教程里沒有說。
failed; nested exception is java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
解決:
<!-- JstlView必須的兩個(gè)jar -->
<dependency>
? ?<groupId>jstl</groupId>
? ?<artifactId>jstl</artifactId>
? ?<version>1.2</version>
</dependency>
<dependency>
? ?<groupId>taglibs</groupId>
? ?<artifactId>standard</artifactId>
? ?<version>1.1.2</version>
</dependency>
問題三 訪問路徑 在tomcat里必須要有項(xiàng)目名稱 不然會(huì)404(教程里是http://localhost:8080/hello/mvc)
應(yīng)該是http://localhost:8080/spring-mvc-study/hello/mvc 才可以訪問
不懂jetty,希望知道的人可以告訴我這是不是tomcat和jetty的差別。
2017-05-11
大神,我用的也是tomcat,但是報(bào)404,
訪問地址: http://localhost:8080/ZLearnSpringMvc/hello/mvc
ZLearnSpringMvc是我的項(xiàng)目名,請(qǐng)問哪里的問題,求解答。。
2016-04-05
非常贊!
2016-03-31
問題一 項(xiàng)目jsp會(huì)報(bào)錯(cuò) The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
解決辦法:web工程-》屬性或Build Path-》Java Build Path->Libraries-> Add Libray...->Server Runtime -》Apache tomcat ?7.0 -》finish
問題二 有兩個(gè)包需要加,不然會(huì)報(bào)錯(cuò)。教程里沒有說。
failed; nested exception is java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
解決:
<!-- JstlView必須的兩個(gè)jar -->
<dependency>
? ?<groupId>jstl</groupId>
? ?<artifactId>jstl</artifactId>
? ?<version>1.2</version>
</dependency>
<dependency>
? ?<groupId>taglibs</groupId>
? ?<artifactId>standard</artifactId>
? ?<version>1.1.2</version>
</dependency>
問題三 訪問路徑 在tomcat里必須要有項(xiàng)目名稱 不然會(huì)404(教程里是http://localhost:8080/hello/mvc)
應(yīng)該是http://localhost:8080/spring-mvc-study/hello/mvc 才可以訪問
不懂jetty,希望知道的人可以告訴我這是不是tomcat和jetty的差別。
2016-03-30
證明服務(wù)器端沒有該文件