為什么登錄成功后訪問 http://localhost:8080/ 會報404錯誤?
我的shiro配置:
<bean?id="shiroFilter"?class="org.apache.shiro.spring.web.ShiroFilterFactoryBean"> ????<property?name="securityManager"?ref="defaultWebSecurityManager"/> ????<property?name="loginUrl"?value="login.html"/> ????<property?name="unauthorizedUrl"?value="403.html"/> ????<property?name="filterChainDefinitions"> ????????<value> ????????????<!--無論下面是否配置?/?=?anon?訪問http://localhost:8080/?都會報404錯誤--> ????????????/?=?anon ????????????/index.html?=?anon ????????????/login.html?=?anon ????????????/subLogin?=?anon ????????????/*?=?authc ????????</value> ????</property> </bean>
其他頁面都正常:
這時沒有登錄過,直接地址欄輸入:http://localhost:8080/index.html?可以正常訪問
點擊登錄輸入用戶名密碼提交:
提交 登錄成功以后:
然后把地址欄改為??http://localhost:8080?回車就報404
?
2020-10-11
遇到同樣問題,修改server中的server locations為第二個選項,部署到服務器發布,已經解決
2019-11-29
你這個問題解決了嗎 我也遇到了這個問題
2019-09-10
在tomcat里面的webapps少了Root,剛剛解決?
2018-06-09
默認起始頁要在web.xml里面配置的。
2018-05-21
自己頂一下,我問的不是404是什么意思,請看過這個視頻教程的認真看我的問題,訪問的是項目根目錄,根目錄下有這個index.html 。我是跟著老師一步一步 做的。發現登錄成功以后訪問跟目錄,就報404.推測是 shiro和springmvc的過濾器攔截有沖突。
2018-05-17
因為這個后面沒有任何資源給他訪問,所以就是404,404就像是空指針。沒有就報錯