在登录页面点击登录404 controller 注解也添加了 html路径也没错 找不到问题了,请各位指点

来源:4-1 Shiro集成Spring

weixin_慕数据5184775

2019-09-26 09:28

http://img3.mukewang.com/5d8c13c900012fa112540718.jpghttp://img4.mukewang.com/5d8c13dc0001bc0a09780627.jpghttp://img.mukewang.com/5d8c13f100015f4c12510619.jpg

登录提示404


http://img3.mukewang.com/5d8c142d0001880709290299.jpg

写回答 关注

3回答

  • 慕瓜2271864
    2020-05-09 19:09:49
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
             version="4.0">
    
        <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath*:spring/spring.xml</param-value>
        </context-param>
    
        <!--Spring监听器-->
        <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>
        <listener>
            <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
        </listener>
    
        <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>
    
        
        <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>
            <load-on-startup>1</load-on-startup>
        </servlet>
        <servlet-mapping>
            <servlet-name>SpringMVC</servlet-name>
            <url-pattern>/</url-pattern>
        </servlet-mapping>
    </web-app>

    web.xml


    另外,在pom.xml中spring依赖的版本最好换成4.3以上

  • 叶落乌啼
    2019-10-19 21:15:28

    只不过是前后调换了一下

  • 慕后端3084861
    2019-10-14 14:38:42

    前方高能!!!!!注意注意!!!!老师估计手误 ,,排除静态资源那个地方应该是这样 !!好坑啊  !!!!http://img3.mukewang.com/5da417e70001146e04820077.jpg

Shiro安全框架入门

从零入门Shiro安全框架

48050 学习 · 347 问题

查看课程

相似问题