spring+springMVC+mybatis+shiro -- 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">

    <!-- 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>

    <!-- spring监听器 -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:spring-config.xml</param-value>
    </context-param>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <!-- springMVC前端控制器 -->
    <servlet>
        <servlet-name>DispatcherServlet</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:applicationContext/spring-mvc.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>DispatcherServlet</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

    <!-- shiro -->
    <filter>
        <filter-name>shiroFilter</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        <init-param>
            <param-name>targetFilterLifecycle</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>shiroFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <welcome-file-list>
        <welcome-file>/WEB-INF/welcome.jsp</welcome-file>
    </welcome-file-list>
    <error-page>
        <error-code>404</error-code>
        <location>/WEB-INF/view/error/404.jsp</location>
    </error-page>
    <error-page>
        <error-code>500</error-code>
        <location>/WEB-INF/view/error/500.jsp</location>
    </error-page>

</web-app>

  在网上看到好多都说springMVC必须在 shiroFilter前面,经测试,和位置没有关系,或者本人没有测试出应该有的功能,请大神指教。

时间: 2024-08-11 05:44:30

spring+springMVC+mybatis+shiro -- web.xml的相关文章

spring+springMVC+mybatis+shiro -- spring-config.xml

<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/sch

spring +springmvc+mybatis组合web.xml文件配置

<?xml version="1.0" encoding="UTF-8"?><web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee ht

基于Spring+SpringMVC+Mybatis的Web系统搭建

主要的后端架构:Spring+SpringMVC+Mybatis+Shiro+Maven  IDE:IntelliJ IDEA 15.0.2 jdk:1.8.0_66 系统完整源码 https://github.com/Wellat/Factor 系统目录结构 跑起来效果 搭建步骤 1.用Idea创建maven项目 2.配置pom.xml文件,添加依赖 1 <?xml version="1.0" encoding="UTF-8"?> 2 <proj

shiro入门应用示例(采用spring+springmvc+mybatis+shiro)

原文:shiro入门应用示例(采用spring+springmvc+mybatis+shiro) 源代码下载地址:http://www.zuidaima.com/share/1550463711726592.htm shiro入门应用示例供参考(采用spring+springmvc+mybatis+shiro) 项目完整源码 链接: http://pan.baidu.com/s/1uyc7I 密码:qk0j

在eclipse中使用spring,springmvc,mybatis搭建web项目

前不久刚学过ssm框架的使用,在此记录下来,如果内容有误欢迎指正! 这篇文章只展示我建立项目的过程,至于各种配置这么写的原因在今后的时间里我会为Spring,Springmvc,mybatis各写一篇文章进行说明! 创建一个web项目 我使用的是eclipse,相信大多数新手都和我一样吧,新建web项目就不说了,各位应该都如喝水吃饭一样熟练了. 导入项目需要的jar包 我是在eclipse中建立的maven项目,因此在pom.xml中写导入jar包的配置,maven自行下载jar包,目前只会这一

shiro与Web项目整合-Spring+SpringMVC+Mybatis+Shiro(八)

Jar包 Web.xml中配置shiro的filter <?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://ja

4.IDEA用maven新建spring+springmvc+mybatis的web工程

4.IDEA新建maven+springmvc的web工程 1.新建web工程 2.导入框支持 3.配置web.xml 4.配置spring.xml 5.配置spring-mvc.xml 6.配置spring-batais.xml 7.书写POJO 8.编辑POJO的xml 9.测试访问

【maven构建大型互联网企业架构源码】spring+springmvc+mybatis+shiro

下载源码猛搓这里 maven构建springmvc+mybatis+rest+bootstrap(cms开源)SpringMVC + Mybatis + SpringSecurity(权限控制到方法按钮) + Rest(服务) + Webservice(服务) + Quartz(定时调度)+ Lucene(搜索引擎) + HTML5 bootstrap + Maven项目构建绝对开源平台项目Mave构建,模拟大型互联网架构,做到高并发,大数据处理,整个项目使用定制化服务思想,提供原子化.模块化的

spring +springmvc+mybatis组合applicationContext.xml文件配置

<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/sche