亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

登錄頁報404

啟動項目控制臺不報錯? 登錄頁報404https://img1.sycdn.imooc.com//5c0e530c0001cf2b13320751.jpg圖片是控制臺的

web.xml文件

<?xml?version="1.0"?encoding="UTF-8"?>
<web-app?xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"?xmlns="http://java.sun.com/xml/ns/javaee"
?????????xsi:schemaLocation="http://java.sun.com/xml/ns/javaee?http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
?????????id="WebApp_ID"?version="3.0">


????<!--?當啟動項目后,直接訪問項目默認啟動的頁面?-->

????<filter>
????????<filter-name>shiroFilter</filter-name>
????????<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
????</filter>
????
????<filter-mapping>
????????<filter-name>shiroFilter</filter-name>
????????<url-pattern>/*</url-pattern>
????</filter-mapping>

????<!--?加載spring的IOC(業務對象(dao、biz)等對象的創建和管理)和AOP(聲明式事務)功能的配置文件,即applicationContext.xml(spring.xml)?-->
????<listener>
????????<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
????</listener>
????<!--?spring.xml文件的路徑配置?-->
????<context-param>
????????<param-name>contextConfigLocation</param-name>
????????<param-value>classpath:spring/spring.xml</param-value>
????</context-param>


????<servlet>
????????<servlet-name>springmvc</servlet-name>
????????<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
????????<init-param>
????????????<param-name>contextConfigLocation</param-name>
????????????<param-value>classpath:spring/springmvc.xml</param-value>
????????</init-param>
????</servlet>
????<!--?配置spring-mvc的訪問路徑?-->
????<servlet-mapping>
????????<servlet-name>springmvc</servlet-name>
????????<url-pattern>/</url-pattern>
????</servlet-mapping>


????<filter>
????????<filter-name>encodingFilter</filter-name>
????????<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
????????<init-param>
????????????<param-name>encoding</param-name>
????????????<param-value>UTF-8</param-value>
????????</init-param>
????????<init-param>
????????????<param-name>forceEncoding</param-name>
????????????<param-value>true</param-value>
????????</init-param>
????</filter>
????<filter-mapping>
????????<filter-name>encodingFilter</filter-name>
????????<url-pattern>/*</url-pattern>
????</filter-mapping>


????<filter>
????????<filter-name>HiddenHttpMethodFilter</filter-name>
????????<filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
????</filter>
????<filter-mapping>
????????<filter-name>HiddenHttpMethodFilter</filter-name>
????????<url-pattern>/*</url-pattern>
????</filter-mapping>
</web-app>

有寫錯嗎

正在回答

6 回答

<property?name="loginUrl"?value="/login.html"?/>
要這樣寫,login.html前面加上/


0 回復 有任何疑惑可以回復我~

https://img1.sycdn.imooc.com//5c46d5d00001afad07420290.jpg

https://img1.sycdn.imooc.com//5c46d5d00001ea5705420329.jpg

https://img1.sycdn.imooc.com//5c46d5d30001e46607310660.jpg

麻煩各位大佬,磅看看! 這是spring.xml spring-mv.xml controller代碼 啟動Tomcat就報404錯誤!


0 回復 有任何疑惑可以回復我~
你的問題解決了嗎?
0 回復 有任何疑惑可以回復我~

我是把tomcat里該項目的所有代碼拷到root下解決了

0 回復 有任何疑惑可以回復我~

請問這個問題是怎么解決的

0 回復 有任何疑惑可以回復我~

有看過spring.xml配置文件嗎?有可能是spring.xml中的shiroFilter沒有配置好,另外

https://img1.sycdn.imooc.com//5c0f25ec0001994018740480.jpg在ieda中啟動服務器后,應該會有圖中紅框所標位置的,在那里可以看到你的錯誤信息,如果其中有shiroFilter就代表你是spring.xml中的shiroFilter沒有配置好

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

登錄頁報404

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號