`
jsjxqjy
  • 浏览: 116845 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论

strtus2 struts.properties

阅读更多

这个文件是struts2框架的全局属性文件,也是自动加载的文件。该文件包含了系列的key-value对。该文件完全可以配置在struts.xml文件中,使用constant元素。下面是这个文件中一些常见的配置项及说明。

 

### 指定加载struts2配置文件管理器,默认为org.apache.struts2.config.DefaultConfiguration
	### 开发者可以自定义配置文件管理器,该类要实现Configuration接口,可以自动加载struts2配置文件。
	# struts.configuration=org.apache.struts2.config.DefaultConfiguration
	### 设置默认的locale和字符编码
	# struts.locale=en_US
	struts.i18n.encoding=UTF-8
	### 指定struts的工厂类
	# struts.objectFactory = spring
	### 指定spring框架的装配模式
	### 装配方式有: name, type, auto, and constructor (name 是默认装配模式)
	struts.objectFactory.spring.autoWire = name
	### 该属性指定整合spring时,是否对bean进行缓存,值为true or false,默认为true.
	struts.objectFactory.spring.useClassCache = true
	### 指定类型检查
	#struts.objectTypeDeterminer = tiger
	#struts.objectTypeDeterminer = notiger
	### 该属性指定处理 MIME-type multipart/form-data,文件上传
	# struts.multipart.parser=cos
	# struts.multipart.parser=pell
	struts.multipart.parser=jakarta
	# 指定上传文件时的临时目录,默认使用 javax.servlet.context.tempdir
	struts.multipart.saveDir=
	struts.multipart.maxSize=2097152
	### 加载自定义属性文件 (不要改写struts.properties!)
	# struts.custom.properties=application,org/apache/struts2/extension/custom
	### 指定请求url与action映射器,默认为org.apache.struts2.dispatcher.mapper.DefaultActionMapper
	#struts.mapper.class=org.apache.struts2.dispatcher.mapper.DefaultActionMapper
	### 指定action的后缀,默认为action
	struts.action.extension=action
	### 被 FilterDispatcher使用
	### 如果为 true 则通过jar文件提供静态内容服务.
	### 如果为 false 则静态内容必须位于 <context_path>/struts
	struts.serve.static=true
	### 被 FilterDispatcher使用
	### 指定浏览器是否缓存静态内容,测试阶段设置为false,发布阶段设置为true.
	struts.serve.static.browserCache=true
	### 设置是否支持动态方法调用,true为支持,false不支持.
	struts.enable.DynamicMethodInvocation = true
	### 设置是否可以在action中使用斜线,默认为false不可以,想使用需设置为true.
	struts.enable.SlashesInActionNames = false
	### 是否允许使用表达式语法,默认为true.
	struts.tag.altSyntax=true
	### 设置当struts.xml文件改动时,是否重新加载.
	### - struts.configuration.xml.reload = true
	### 设置struts是否为开发模式,默认为false,测试阶段一般设为true.
	struts.devMode = false
	### 设置是否每次请求,都重新加载资源文件,默认值为false.
	struts.i18n.reload=false
	###标准的UI主题
	### 默认的UI主题为xhtml,可以为simple,xhtml或ajax
	struts.ui.theme=xhtml
	###模板目录
	struts.ui.templateDir=template
	#设置模板类型. 可以为 ftl, vm, or jsp
	struts.ui.templateSuffix=ftl
	###定位velocity.properties 文件.   默认 velocity.properties
	struts.velocity.configfile = velocity.properties
	### 设置velocity的context.
	struts.velocity.contexts =
	### 定位toolbox.
	struts.velocity.toolboxlocation=
	### 指定web应用的端口.
	struts.url.http.port = 80
	### 指定加密端口
	struts.url.https.port = 443
	### 设置生成url时,是否包含参数.值可以为: none, get or all
	struts.url.includeParams = get
	### 设置要加载的国际化资源文件,以逗号分隔.
	# struts.custom.i18n.resources=testmessages,testmessages2
	### 对于一些web应用服务器不能处理HttpServletRequest.getParameterMap()
	### 像 WebLogic, Orion, and OC4J等,须设置成true,默认为false.
	struts.dispatcher.parametersWorkaround = false
	### 指定freemarker理器
	#struts.freemarker.manager.classname=org.apache.struts2.views.freemarker.FreemarkerManager
	### 设置是否对freemarker的模板设置缓存
	### 效果相当于把template拷贝到 WEB_APP/templates.
	struts.freemarker.templatesCache=false
	### 通常不需要修改此属性.
	struts.freemarker.wrapper.altMap=true
	### 指定xslt result是否使用样式表缓存.开发阶段设为true,发布阶段设为false.
	struts.xslt.nocache=false
	### 设置struts自动加载的文件列表.
	struts.configuration.files=struts-default.xml,struts-plugin.xml,struts.xml
	### 设定是否一直在最后一个slash之前的任何位置选定namespace.
	struts.mapper.alwaysSelectFullNamespace=false

 

分享到:
评论
发表评论

文章已被作者锁定,不允许评论。

相关推荐

    struts2的struts.properties配置文件详解

    Struts2的Struts.properties配置文件详解 Struts2是一个基于MVC模式的Web应用程序框架,它提供了一个名为Struts.properties的配置文件,该文件用于配置Struts2的各种参数和设置。下面将对Struts.properties配置文件...

    Struts课堂笔记.rar--struts2的struts.properties配置文件详解

    The org.apache.struts2.config.Configuration implementation class org.apache.struts2.config.Configuration接口名 struts.configuration.files A list of configuration files automatically loaded by ...

    详解struts2中struts.properties.doc

    在Struts2中,配置文件起着至关重要的作用,其中`struts.xml`用于管理Action映射和Result定义,而`struts.properties`文件则用于定义框架的全局属性。这个文件是基于Properties格式的,存储了一系列键值对,用于定制...

    struts2的struts.properties介绍

    详尽的struts2的struts.properties各个属性介绍

    解决Struts中ApplicationResources.properties文件不支持中文问题

    2. 手动安装 Properties Editor 的 Jar 包:可以下载 Properties Editor 的 Jar 包,并手动安装到 Eclipse 中。 3. 通过 Eclipse 自动安装:可以使用 Eclipse 的插件安装功能来安装 Properties Editor 工具,这是...

    struts.xml和struts.properties配置详解

    NULL 博文链接:https://wellfrog.iteye.com/blog/612014

    struts.xml文件详解.doc

    struts.properties文件是Struts 2框架的一个重要配置文件,它位于Web应用的WEB-INF/classes目录下或CLASSPATH路径下。这个文件定义了一系列框架的属性,允许开发者调整Struts 2的行为以适应特定的应用需求。例如,你...

    Struts2的常量详解

    struts.custom.properties 属性指定 Struts 2 应用加载用户自定义的属性文件,该自定义属性文件指定的属性不会覆盖 struts.properties 文件中指定的属性。 12. struts.mapper.class struts.mapper.class 属性指定...

    struts.properties文件详解

    Struts.properties 文件是 Struts2 框架的核心配置文件之一,它定义了框架的行为和各种默认设置。这个文件主要用于定制 Struts2 的工作环境,包括配置管理器、国际化、对象工厂、文件上传、请求映射等多个方面。下面...

    struts.properties详解

    struts.properties详解,每一行都给注释了,值得你一看哦

    struts2 properties配置详解

    自己学会的,保存的学习网页,给大家分享 struts2 国际化

    Struts2技术手册-Struts2精华教程-电子书

    .....struts.properties .....Action_编写与配置 .....Action_访问容器与校验 .....Action_ResultType .....XWork拦截器 .....XWork转换器 .....XWork校验器_使用 .....XWork校验器_定义 .....标签库_简介与OGNL ......

    strut1和struts2深度比较.doc

    - Struts2提供自动类型转换,通过`Converter`接口和`xwork-conversion.properties`配置文件,可以自定义类型转换规则。 **三、ActionContext和OGNL** - Struts2引入了ActionContext,它封装了请求、响应、session...

    Struts2属性文件详解.doc

    11. `struts.custom.properties`:允许加载用户自定义的属性文件,这些属性不会覆盖`struts.properties`文件中的设置。可以使用逗号分隔来指定多个文件。 12. `struts.mapper.class`:定义HTTP请求映射到Action的...

    Struts 2 properties文件详解

    Struts 2 properties文件详解

    Struts2入门教程(全新完整版)

    (3).struts.properties(参default.properties) 4 (4)struts-default.xml 4 (5)其它配置文件 4 4.让MyEclipse提示xml信息 4 5.如何使用alt+/提示 4 6.实例 4 7.开启struts2自带的开发模式常量 6 8.vo传参...

    Struts2属性文件详解

    该属性的默认值为velocity.properties. struts.velocity.contexts 该属性指定Velocity框架的Context位置,如果该框架有多个Context,则多个Context之间以英文逗号(,)隔开. struts.velocity.toolboxlocation 该属性...

Global site tag (gtag.js) - Google Analytics