Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_53077510
production_ssm
提交
663eed3e
P
production_ssm
项目概览
weixin_53077510
/
production_ssm
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
production_ssm
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
663eed3e
编写于
5月 05, 2017
作者:
M
megagao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改了web.xml的xmlns
上级
7f16d22e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
58 addition
and
84 deletion
+58
-84
src/main/webapp/WEB-INF/web.xml
src/main/webapp/WEB-INF/web.xml
+58
-84
未找到文件。
src/main/webapp/WEB-INF/web.xml
浏览文件 @
663eed3e
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
<web-app
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns=
"http://java.sun.com/xml/ns/javaee"
xmlns:web=
"http://java.sun.com/xml/ns/javaee"
xmlns=
"http://java.sun.com/xml/ns/javaee"
xmlns:web=
"http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation=
"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id=
"WebApp_ID"
version=
"2.5"
>
xsi:schemaLocation=
"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
<display-name>
production_ssm
</display-name>
id=
"WebApp_ID"
version=
"2.5"
>
<context-param>
<display-name>
production_ms
</display-name>
<param-name>
contextConfigLocation
</param-name>
<param-value>
classpath:spring/applicationContext-*.xml
</param-value>
<!-- 配置spring容器监听器 -->
</context-param>
<context-param>
<listener>
<param-name>
contextConfigLocation
</param-name>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
<param-value>
classpath:spring/applicationContext-*.xml
</param-value>
</listener>
</context-param>
<servlet>
<listener>
<servlet-name>
springmvc
</servlet-name>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
</listener>
<init-param>
<param-name>
contextConfigLocation
</param-name>
<!-- 加载springMVC servlet, 配置前端控制器 -->
<param-value>
classpath:spring/springmvc-servlet.xml
</param-value>
<servlet>
</init-param>
<servlet-name>
springmvc
</servlet-name>
</servlet>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<servlet-mapping>
<!-- 加载springmvc配置 -->
<servlet-name>
springmvc
</servlet-name>
<init-param>
<url-pattern>
/
</url-pattern>
<param-name>
contextConfigLocation
</param-name>
</servlet-mapping>
<!-- 配置文件的地址 如果不配置contextConfigLocation,默认查找的配置文件为classpath下的:servlet名称+"-serlvet.xml"
<filter>
即:springmvc-serlvet.xml -->
<filter-name>
shiroFilter
</filter-name>
<param-value>
classpath:spring/springmvc-servlet.xml
</param-value>
<filter-class>
org.springframework.web.filter.DelegatingFilterProxy
</filter-class>
</init-param>
<init-param>
</servlet>
<param-name>
targetFilterLifecycle
</param-name>
<param-value>
true
</param-value>
<servlet-mapping>
</init-param>
<servlet-name>
springmvc
</servlet-name>
</filter>
<!-- 可以配置/ ,此工程 所有请求全部由springmvc解析,此种方式可以实现 RESTful方式,需要特殊处理对静态文件的解析不能由
<filter-mapping>
springmvc解析 可以配置*.do或*.action,所有请求的url扩展名为.do或.action由springmvc解析,此种方法常用 不可以/*,
<filter-name>
shiroFilter
</filter-name>
如果配置/*,返回jsp也由springmvc解析,这是不对的。 -->
<url-pattern>
/*
</url-pattern>
<url-pattern>
/
</url-pattern>
</filter-mapping>
</servlet-mapping>
<filter>
<filter-name>
CharacterEncodingFilter
</filter-name>
<!-- shiro的filter -->
<filter-class>
org.springframework.web.filter.CharacterEncodingFilter
</filter-class>
<!-- shiro过虑器,DelegatingFilterProxy通过代理模式将spring容器中的bean和filter关联起来 -->
<init-param>
<filter>
<param-name>
encoding
</param-name>
<filter-name>
shiroFilter
</filter-name>
<param-value>
utf-8
</param-value>
<filter-class>
org.springframework.web.filter.DelegatingFilterProxy
</filter-class>
</init-param>
<!-- 设置true由servlet容器控制filter的生命周期 -->
</filter>
<init-param>
<filter-mapping>
<param-name>
targetFilterLifecycle
</param-name>
<filter-name>
CharacterEncodingFilter
</filter-name>
<param-value>
true
</param-value>
<url-pattern>
/*
</url-pattern>
</init-param>
</filter-mapping>
<!-- 设置spring容器filter的bean id,如果不设置则找与filter-name一致的bean-->
<error-page>
<!--<init-param>
<exception-type>
java.lang.Throwable
</exception-type>
<param-name>targetBeanName</param-name>
<location>
/500.jsp
</location>
<param-value>shiroFilter</param-value>
</error-page>
</init-param>-->
<error-page>
</filter>
<error-code>
500
</error-code>
<filter-mapping>
<location>
/500.jsp
</location>
<filter-name>
shiroFilter
</filter-name>
</error-page>
<url-pattern>
/*
</url-pattern>
<error-page>
</filter-mapping>
<error-code>
404
</error-code>
<location>
/404.jsp
</location>
<!-- post乱码处理 -->
</error-page>
<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>
</filter>
<filter-mapping>
<filter-name>
CharacterEncodingFilter
</filter-name>
<url-pattern>
/*
</url-pattern>
</filter-mapping>
<!-- 出错页面定义 -->
<error-page>
<exception-type>
java.lang.Throwable
</exception-type>
<location>
/500.jsp
</location>
</error-page>
<error-page>
<error-code>
500
</error-code>
<location>
/500.jsp
</location>
</error-page>
<error-page>
<error-code>
404
</error-code>
<location>
/404.jsp
</location>
</error-page>
</web-app>
</web-app>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录