1、指定Struts2处理的请求后缀
<constant name="struts.action.extension" value="com"></constant>
即以.com为后缀(value值为可以为:value=com,action,即表示可以以.com为后缀,也可以以.action为后缀)。注意:是在struts标签下设置。
2、struts2加载常量的搜索顺序:
struts-default.xml-->struts-plugin.xml-->struts.xml-->struts.properties-->web.xml
3、常用常量
A、指定默认编码集
<constant name="struts.i18n.encoding" value="UTF-8"></constant>
B、自动重新加载修改后的配置文件(即修改文件后无需重启服务器):
<constant name="struts.configuration.xmlreload" value="true" />
C、打印错误信息
<constant name="struts.devMode" value="true"></constant>
D、与Spring集成时,指定由spring负责action对象的创建
<constant name="struts.objectFactor" value="spring"></constant>
E、支持动态方法调用,默认值为true
<constant name="struts.enable.DynamicMethodInvocation" value="false"/>
F、上传文件的大小限制
<constant name="struts.multipart.maxSize" value="1230000"></constant>
G、动态调用方法(默认为true)
<constant name="struts.enable.DynamicHethodInvocation" value="false" />
Struts2的处理流程与Action的管理方式
用户请求-->StrutsPrepareAndExecuteFilter(Struts准备和执行过滤)-->Interceptor(核心)-->Action-->Result-->JSP/html-->响应
应用指定多个配置文件
只需一行代码:<include file="xxx.xml" />
注意:是在struts标签下设置
分享到:
相关推荐
struts 2 基础 __继承ActionSupport完成输入校验
SSH_Struts1_Spring_Hibernate_配置开发总结。里面有实例的,大家可以参考下
Struts2中struts_xml的Action配置详解
struts2-scan 检测struts2漏洞,认证检测struts2漏洞
20110930_Struts2_0100_Introduction20110930_Struts2_0100_Introduction20110930_Struts2_0100_Introduction20110930_Struts2_0100_Introduction20110930_Struts2_0100_Introduction
[轻量级Java_EE企业应用实战_Struts2_Spring3_Hibernate整合开发
Struts2_1000_CharacterEncodingStruts2_1000_CharacterEncodingStruts2_1000_CharacterEncoding
Struts2_interceptor_和_filter区别
Struts2和JSON交互的例子,非常容易理解,Struts2和JSON交互的例子,非常容易理解。
浪曦_Struts2应用开发系列_第1讲.Struts2入门与配置_swf
struts2_spring_hibernate jar图struts2_spring_hibernate jar图struts2_spring_hibernate jar图
官方描述: ... ... 官方建议修复方案:升级到最新版本 struts-2.3.15.1 但通常现有系统升级,可能导致不稳定及与其他...鉴于此csdn网友jzshmyt整理了一种既可以不用升级现有struts版本,有能完美解决这两个漏洞的方案,
struts2_spring_hibernatestruts2_spring_hibernate
struts2_hibernate_spring日程管理系统
NULL 博文链接:https://wxl1990721.iteye.com/blog/1998685
NULL 博文链接:https://wxl1990721.iteye.com/blog/1998648
struts2_mybatis_spring_框架整合实例_数据库 源码中包括数据库文件 文档介绍
简述STRUTS2_Convention零配置
struts2_spring_mybatis整合案例
struts2_core_JAR开发包 MVC思想Xwork为技术核心。