struts2的默认配置文件default.properties在和核心包中的org.apache.struts2下。可以通过eclipse进行查看。

对struts2的属性配置进行调整有两种方法。下面以struts.action.extension为例进行说明。

方法一:在class路径下添加struts.properties配置文件。

1 struts.action.extension=action,do,go

方法二:修改class路径下的struts2.xml文件

1 <constant name=”struts.action.extension” value=”action,do,go” />

Struts2各项配置的说明:

struts.action.extension
The URL extension to use to determine if the request is meant for a Struts action
用URL扩展名来确定是否这个请求是被用作Struts action,其实也就是设置 action的后缀,例如login.do的"'do"'字。

struts.configuration
The org.apache.struts2.config.Configuration implementation class
org.apache.struts2.config.Configuration接口名

struts.configuration.files
A list of configuration files automatically loaded by Struts
struts自动加载的一个配置文件列表

struts.configuration.xml.reload
Whether to reload the XML configuration or not
是否加载xml配置(true,false)

struts.continuations.package
The package containing actions that use Rife continuations
含有actions的完整连续的package名称

struts.custom.i18n.resources
Location of additional localization properties files to load
加载附加的国际化属性文件(不包含.properties后缀)

struts.custom.properties
Location of additional configuration properties files to load
加载附加的配置文件的位置

struts.devMode
Whether Struts is in development mode or not
是否为struts开发模式

struts.dispatcher.parametersWorkaround
Whether to use a Servlet request parameter workaround necessary for some versions of WebLogic
(某些版本的weblogic专用)是否使用一个servlet请求参数工作区(PARAMETERSWORKAROUND)

struts.enable.DynamicMethodInvocation
Allows one to disable dynamic method invocation from the URL
允许动态方法调用

struts.freemarker.manager.classname
The org.apache.struts2.views.freemarker.FreemarkerManager implementation class
org.apache.struts2.views.freemarker.FreemarkerManager接口名

struts.i18n.encoding
The encoding to use for localization messages
国际化信息内码

struts.i18n.reload
Whether the localization messages should automatically be reloaded
是否国际化信息自动加载

struts.locale
The default locale for the Struts application
默认的国际化地区信息

struts.mapper.class
The org.apache.struts2.dispatcher.mapper.ActionMapper implementation class
org.apache.struts2.dispatcher.mapper.ActionMapper接口

struts.multipart.maxSize
The maximize size of a multipart request (file upload)
multipart请求信息的最大尺寸(文件上传用)

struts.multipart.parser
The org.apache.struts2.dispatcher.multipart.
MultiPartRequest parser implementation for a multipart request (file upload)
专为multipart请求信息使用的org.apache.struts2.dispatcher.multipart.MultiPartRequest解析器接口(文件上传用)

struts.multipart.saveDir
The directory to use for storing uploaded files
设置存储上传文件的目录夹

struts.objectFactory
The com.opensymphony.xwork2.ObjectFactory implementation class
com.opensymphony.xwork2.ObjectFactory接口(spring)

struts.objectFactory.spring.autoWire
Whether Spring should autoWire or not
是否自动绑定Spring

struts.objectFactory.spring.useClassCache
Whether Spring should use its class cache or not
是否spring应该使用自身的cache

struts.objectTypeDeterminer
The com.opensymphony.xwork2.util.ObjectTypeDeterminer implementation class
com.opensymphony.xwork2.util.ObjectTypeDeterminer接口

struts.serve.static.browserCache
If static content served by the Struts filter should set browser caching header properties or not
是否struts过滤器中提供的静态内容应该被浏览器缓存在头部属性中

struts.serve.static
Whether the Struts filter should serve static content or not
是否struts过滤器应该提供静态内容

struts.tag.altSyntax
Whether to use the alterative syntax for the tags or not
是否可以用替代的语法替代tags

struts.ui.templateDir
The directory containing UI templates
UI templates的目录夹

struts.ui.theme
The default UI template theme
默认的UI template主题

struts.url.http.port
The HTTP port used by Struts URLs
设置http端口

struts.url.https.port
The HTTPS port used by Struts URLs
设置https端口

struts.url.includeParams
The default includeParams method to generate Struts URLs
在url中产生 默认的includeParams

struts.velocity.configfile
The Velocity configuration file path
velocity配置文件路径

struts.velocity.contexts
List of Velocity context names
velocity的context列表

struts.velocity.manager.classname
org.apache.struts2.views.velocity.VelocityManager implementation class
org.apache.struts2.views.velocity.VelocityManager接口名

struts.velocity.toolboxlocation
The location of the Velocity toolbox
velocity工具盒的位置

struts.xslt.nocache
Whether or not XSLT templates should not be cached
是否XSLT模版应该被缓存

转载于:https://www.cnblogs.com/amunote/articles/Action.html

struts2学习笔记(二):Struts2配置相关推荐

  1. struts2学习笔记二--准备struts2的学习和开发环境

    准备struts2的学习和开发环境 1 导包 2 参照开发包自带的例子在web.xml文件中配置 3 参照开发包自带的例子编写Action类和配置struts.xml文件 <struts> ...

  2. Struts2学习总结二

    Struts2框架学习 Struts2学习总结二 1.请求封装参数 1.1.动作类作为实体模型 1.1.1.创建UserAction类 1.1.2.创建struts.xml并编写 1.1.3.编写we ...

  3. MVC缓存OutPutCache学习笔记 (一) 参数配置

    OutPutCache 参数详解 Duration : 缓存时间,以秒为单位,这个除非你的Location=None,可以不添加此属性,其余时候都是必须的. Location : 缓存放置的位置; 该 ...

  4. CAS单点登录学习笔记二之部署CAS Server

    CAS Server 服务器部署 [b]简介[/b] CAS Server 是一套基于 Java 实现的服务,该服务以一个 Java Web Application 单独部署在与 servlet2.3 ...

  5. 学习笔记二.矩阵按键

    #学习笔记二:GPIO的探索与矩阵按键 ##1.在配置cubemx时,对gpio的配置有开漏输出和推挽输出两种方式, ###这里有一篇文章(别人的文章)讲的很详细link戳这里跳转 通俗来讲,推挽输出 ...

  6. [MyBatis学习笔记] 二、Mybatis基本操作及相关标签介绍

    [MyBatis学习笔记] 二.Mybatis基本操作及相关标签介绍 一.Mybatis简介 二.简单的CRUD操作 1.构建SqlSessionFactory (1)编辑mybatis-config ...

  7. css中怎么加入立体模型,CSS学习笔记二:css 画立体图形

    继上一次学了如何去运用css画平面图形,这一次学如何去画正方体,从2D向着3D学习,虽然有点满,但总是一个过程,一点一点积累,然后记录起来. Transfrom3D 在这一次中运用到了一下几种属性: ...

  8. Mysql学习笔记(二)——表格及数据的插入

    Mysql学习笔记(二)--表格及数据的插入 文章目录 Mysql学习笔记(二)--表格及数据的插入 1.Mysql常用指令 2.创建表格 A.数据类型 B.完整性约束条件 3.查看表格 4.修改表格 ...

  9. Spring Boot 框架学习笔记(二)(配置文件与数据注入 yaml基本语法 JSR303数据验证 多环境切换 )

    Spring Boot 框架学习笔记(二) 六.appliaction.properties配置与数据注入 6.1 `@Value`注解 测试注入数据 读取输入流 6.2 读取配置文件数据注入 单文件 ...

  10. springmvc学习笔记二:重定向,拦截器,参数绑定

    springmvc学习笔记二:重定向,拦截器,参数绑定 Controller方法返回值 返回ModelAndView controller方法中定义ModelAndView对象并返回,对象中可添加mo ...

最新文章

  1. 驾驭白夜场景、刷新多个SOTA,高效提升多目标追踪与分割
  2. 从该函数中确定函数名称(不使用回溯)
  3. 下列不属于android布局的是( ),Android软件工程师笔试题(全选择题)【0-1年经验】...
  4. Android OTA 升级之三:生成recovery.img
  5. 有关STM32外设配置的几个常见问题
  6. Hadoop环境搭建教学(二)完全分布式集群搭建;
  7. Teams Meeting App的 task 弹出框
  8. webstorm 配置sass
  9. latex 生成pdf显示行号
  10. java安装后打开jar文件_java环境变量配置好后双击jar文件无法运行的解决办法
  11. ebyte Lora 转 4G 透传通讯测试
  12. 配置Jinjia2模板引擎
  13. Window10 打开ftp服务
  14. 2021-01-06
  15. 批量修改文件名为上级目录名字
  16. 天龙八部搭建mysql教程_天龙八部私服架设mysql数据库安装
  17. [SCOI2012]滑雪 洛谷p2573
  18. STC89C52RC
  19. Maya的auto save 自動保存
  20. outlook如何添加收件人到通讯薄-----outlook的一个bug

热门文章

  1. ORM对mysql数据库中数据进行操作报错解决
  2. Loadrunner压测时,出现的问题汇总
  3. tornado 学习笔记15 _ServerRequestAdapter分析
  4. (转)对微软那棵TreeView进行试用,主要是对CheckBox进行操作
  5. ViewBag与ViewData传值乱码问题解决方案
  6. 最新版OpenWrt编译教程,解决依赖问题
  7. Tomcat - ClassFormatException的解决方法
  8. tomcat启动命令行窗口出现乱码的解决方法
  9. python使用退格键时出现^H解决方法
  10. Ubuntu 14.04更新为国内阿里源解决apt-get install无法执行的问题