jsp 页面都放在了 web-inf文件夹下
 shiro过滤器[ <!-- 11Shiro的Web过滤器 -->
    <bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
        <property name="securityManager" ref="securityManager"/>
        <property name="loginUrl" value="/login"/>
        <property name="successUrl" value="/"/>
        <property name="unauthorizedUrl" value="/unauthorized.jsp"/>
        <!--<property name="filters">-->
            <!--<util:map>-->
                <!--<entry key="sysUser" value-ref="sysUserFilter"/>-->
            <!--</util:map>-->
        <!--</property>-->
        <!--Shiro过滤链的定义-->
       <!-- anon:例子/admins/**=anon 没有参数,表示可以匿名使用。-->
        <property name="filterChainDefinitions">
            <value>
                /ui/** = anon
                /user/login = anon
                /login = anon
                /unauthorized = anon
                /** = user
            </value>
        </property>
    </bean>
controller层
<!--配置渲染器-->
    <bean id="jspViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
    <!--结果视图的前缀-->
    <property name="prefix" value="/WEB-INF/jsp/"/>
    <!--结果视图的后缀-->
    <property name="suffix" value=".jsp"/>
    <!--这样就会自动去找 /web-inf/jsp/hello.jsp 去了-->
    </bean>页面显示 404 

解决方案 »

  1.   

    项目的web.xml配置了项目的根目录了吗没有,url中就需要加上默认的项目名
      

  2.   

    web.xml
    <?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_3_1.xsd"
             version="3.1">
      <display-name>Archetype Created Web Application</display-name>  <!--Spring 编码过滤器-->
      <filter>
        <filter-name>characterEncodingFilter</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>characterEncodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
      </filter-mapping>  <!--log4j的日志配置-->
      <!--<context-param>-->
      <!--<param-name>log4jConfigLocation</param-name>-->
      <!--<param-value>/WEB-INF/classes/log4j.properties</param-value>-->
      <!--</context-param>-->
      <!--<context-param>-->
      <!--<param-name>log4jRefreshInterval</param-name>-->
      <!--<param-value>60000</param-value>-->
      <!--</context-param>-->
      <!--&lt;!&ndash; 需要添加spring-web.jar包,否则用发生错误信息 &ndash;&gt;-->
      <!--<listener>-->
      <!--<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>-->
      <!--</listener>-->  <!--Shiro过滤器定义-->
      <filter>
        <filter-name>shiroFilter</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        <init-param>
          <!--该值缺省值为false,表示生命周期由SpringApplicationContext管理,设置为true则表示由ServletContainer管理-->
          <param-name>targetFilterLifecycle</param-name>
          <param-value>true</param-value>
        </init-param>
      </filter>
      <filter-mapping>
        <filter-name>shiroFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
      </filter-mapping>  <!--支持GET,PUT,POST,与Delete请求-->
      <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>
      <!--加载spring容器-->
      <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:spring/applicationContext-*</param-value>
      </context-param>
      <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
      </listener>  <!--获取Request和Session-->
      <!--<listener>-->
      <!--<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>-->
      <!--</listener>-->  <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>
      

  3.   

    会不会是跳转页面的url写的不对,我就是这个问题