<struts>
 <!--开发模式设置:该属性设置Struts2应用是否使用开发模式。如果设置该属性为true,则可以在应用出错时显示更多、更友好的出错提示。该属性只接受true和flase两个值,该属性的 默认值是false。通常,应用在开发阶段,将该属性设置为true,当进入产品发布阶段后,则该属性设置为false。 -->
 <constant name="struts.devMode" value="false"></constant>
 <!-- 国际化资源重新加载:该属性设置是否每次HTTP请求到达时,系统都重新加载资源文件。该属性默认值是false。在开发阶段将该属性设置为true会更有利于开发, 但在产品发布阶段应将该属性设置为false。 -->
 <constant name="struts.i18n.reload" value="false" />
 <!-- 配置文件重新加载:该属性设置当struts.xml文件改变后,系统是否自动重新加载该文件。该属性的默认值是false。 -->
 <constant name="struts.configuration.xml.reload" value="false" />
 <!-- convention类重新加载 -->
 <constant name="struts.convention.classes.reload" value="false" />
 <!-- 主题:该属性指定视图标签默认的视图主题,该属性的默认值是xhtml -->
 <constant name="struts.ui.theme" value="simple" />
 <!-- 地区 -->
 <constant name="struts.locale" value="zh_CN" />
 <!-- spring -->
 <!-- <constant name="struts.objectFactory" value="spring"/> -->
 <!-- <constant name="struts.objectFactory.spring.autoWire" value="byName"/> -->
 <!-- 国际化编码:指定Web应用的默认编码集,相当于调用 HttpServletRequest的setCharacterEncoding方法 -->
 <constant name="struts.i18n.encoding" value="UTF-8" />
 <!-- 扩展:该 属性指定需要Struts 2处理的请求后缀,该属性的默认值是action,即 所有匹配*.action的请求都由Struts 2处理。如果用户需要指定多个请求后缀,则多个后缀之间以英文逗号(,)隔开 -->
 <constant name="struts.action.extension" value="action" />
 <!-- 启用动态方法调用:该属性设置Struts 2是否支持动态方法调用,该属性的默认值是true(也区分版本)。如果需要关闭动态方法调用,则可设置该属性为false -->
 <constant name="struts.enable.DynamicMethodInvocation" value="true" />
 <!-- 设置Struts 2是否允许在Action名中使用斜线,默认是false -->
 <constant name="struts.enable.SlashesInActionNames" value="false" />
 <!-- action后缀 -->
 <constant name="struts.convention.action.suffix" value="Action" />
 <!-- 名称首字母小写 -->
 <constant name="struts.convention.action.name.lowercase"
  value="true" />
 <!-- 分隔符 一个action名字的获取。比如为HelloWorldAction。按照配置,actionName为hello_world。 -->
 <constant name="struts.convention.action.name.separator"
  value="" />
 <!-- 禁用扫描 -->
 <constant name="struts.convention.action.disableScanning"
  value="false" />
 <!-- 默认包 -->
 <constant name="struts.convention.default.parent.package"
  value="default" />
 <!--确定搜索包的路径。只要是结尾为action的包都要搜索。basePackage按照默认不用配置,如果配置,只会找以此配置开头的包。
  locators及locators.basePackage都是一组以逗号分割的字符串。 -->
 <constant name="struts.convention.package.locators" value="action" />
 <!-- 禁用包搜索 -->
 <constant name="struts.convention.package.locators.disable"
  value="false" />
 <!-- 告诉struts2 需要在哪些jar包中去搜索 action -->
 <constant name="struts.convention.action.includeJars" value=".*/jenny-plugin.*?jar(!/)?," />
 <!-- 告诉struts2 去包中查找action的包文件类型,默认是jar,如果在webspher上可能会出问题,需要添加 wsjar -->
 <constant name="struts.convention.action.fileProtocols" value="jar" />
 <!-- 基于什么包 -->
 <constant name="struts.convention.package.locators.basePackage"
  value="com.speed.call.plugin.server.action" />
 <!-- 排除的包 -->
 <constant name="struts.convention.exclude.packages"
  value="org.apache.struts.*,org.apache.struts2.*,org.springframework.web.struts.*,org.springframework.web.struts2.*,org.hibernate.*" />
 <constant name="struts.convention.result.flatLayout" value="false" />
 <constant name="struts.convention.action.mapAllMatches" value="false" />

<package name="default" namespace="/" extends="struts-default">
  <result-types>
   <result-type name="json" class="org.apache.struts2.json.JSONResult">
    <param name="excludeNullProperties">true</param>
    <param name="noCache">true</param>
    <param name="contentType">text/html</param>
   </result-type>
   <!-- result-type name="stream" class="org.apache.struts2.dispatcher.StreamResult">
    <param name="contentType">image/jpeg</param>
    <param name="inputName">imageStream</param>
    <param name="bufferSize">1024</param>
   </result-type-->
  </result-types>
  <interceptors>
   <interceptor name="json"
    class="org.apache.struts2.json.JSONInterceptor" />
   <interceptor name="annotation"
    class="com.opensymphony.xwork2.interceptor.annotations.AnnotationWorkflowInterceptor" />
   <interceptor-stack name="myDefaultStack">
    <interceptor-ref name="json" />
    <interceptor-ref name="annotation" />
    <interceptor-ref name="defaultStack">
     <param name="exception.logEnabled">true</param>
     <param name="exception.logLevel">ERROR</param>
    </interceptor-ref>
   </interceptor-stack>
  </interceptors>
  <default-interceptor-ref name="myDefaultStack"/>
 </package>
</struts>

struts2常见配置的更多相关文章

  1. Struts2常见配置(草稿)

    Struts2框架配置文件加载的顺序(了解加载配置文件的顺序,重点掌握struts.xml配置文件) 1.Struts2框架的核心是StrutsPrepareAndExecuteFilter过滤器,该 ...

  2. struts2常见配置解决错误There is no mapped for namespace[/] and action name

    我碰到这个错误的原因是我把配置文件名写成了Struts.xml,改成struts.xml就可以了. 在确定struts.xml本身并没有写错的情况下,那么发生错误有可能是路径,配置文件名. 如果实在找 ...

  3. struts2学习笔记(三)—— struts2的常见配置

    一.配置文件的加载顺序 每次从客户端发送请求到服务器都要先经过Struts2的核心过滤器StrutsPrepareAndExecuteFilter,这个过滤器有两个功能:预处理和执行.在预处理中主要就 ...

  4. Struts2 XML配置详解

    struts官网下载地址:http://struts.apache.org/   1.    深入Struts2的配置文件 本部分主要介绍struts.xml的常用配置. 1.1.    包配置: S ...

  5. 深入 Struts2 的配置 - 处理多个请求-处理请求结果-模型驱动-异常机制

    转:http://www.java3z.com/cwbwebhome/article/article2/2938.html?id=1631 本部分主要介绍struts.xml的常用配置. 1.1.   ...

  6. Struts2 基本配置

    Struts2是一个优秀的MVC框架,也是我比较喜欢用的框架.它个各种配置基本都可以集中在一个xml文档中完成.现在让我们看看如何简单几步实现常用功能. 一.搭建Struts2的开发环境 1)首先是利 ...

  7. struts2 action配置时 method 省略不写 默认执行方法是父类ActionSuppot中的execute()方法

    struts2 action配置时 method 省略不写 默认执行方法是父类ActionSuppot中的execute()方法

  8. struts2环境配置

    struts2环境配置 struts2框架,大多数框架都在使用.由于工作需要,开始做Java项目.先学个struts2. 一.下载struts2 有好多版本,我下载的是struts-2.2.1.1. ...

  9. 在Struts2中配置Action

    在Struts2中配置Action <package>: 1.定义Action使用<package>标签下的<action>标签完成,一个<package&g ...

随机推荐

  1. apt-get remove, apt-get autoremove和aptitude remove的区别

    这篇文章的图片链接发生了问题,无法正常查看图片,所以我在CSDN转载一下,特此声明. apt-getremove的行为我们很好理解,就是删除某个包的同时,删除依赖于它的包,例如:A依赖于B, B依赖于 ...

  2. linux笔记:网络命令ping,traceroute,ifconfig,netstat;挂载和卸载命令mount,umount

    命令名称:ping功能:测试网络连通性命令所在路径:/bin/ping用法:ping [-c] IP地址参数:-c 指定发送次数 命令名称:ifconfig功能:查看和设置网卡信息(临时设置)命令所在 ...

  3. mathematics

    二倍角公式 史济怀-数学分析1-2003-09-19_2.asx-在线播放-优酷网,视频高清在线观看http://v.youku.com/v_show/id_XMTMzMDU1MTgw.html 国立 ...

  4. Git 分支管理是一门艺术

    转载: Git 分支管理是一门艺术 1 要确保:团队成员从主分支(master)获得的都是处于可发布状态的代码,而从开发分支(develop)应该总能够获得最新开发进展的代码. 2 "辅助分 ...

  5. Android 禁止Viewpager左右滑动功能

    首先自定义一个 继承自 ViewPager的自定义 类 package com.yourcompany; import android.content.Context; import android. ...

  6. 通过Sql语句导数据

    在通过SQL Server向导中的SQL语句导数据时,默认情况下源表中的nvarchar字段类型会变成202,解决此问题的方法是,要重新选择一下对应的数据接收表.

  7. (11)lambda表达式用法

    * lambda 简述    lambda只是一个表达式,函数体比def简单很多    lambda的主体是一个表达式,而不是一个代码块.仅仅能在lambda表达式中封装有限的逻辑进去.    lam ...

  8. Mybatis 学习-1

    本次MyBatis基础实例教程主要讲述MyBatis在项目中的配置方法,实体对象的关系映射.关联关系,以及如何实现一个BaseDao的功能 实例数据库的表结构 CREATE TABLE `blog_u ...

  9. php使用位与运算符【&】位或运算符【|】实现权限管理

    权限值是这样的2^0=1,相应2进数为”0001″(在这里^我表示成”次方”,即:2的0次方,下同)2^1=2,相应2进数为”0010″2^2=4,相应2进数为”0100″2^3=8,相应2进数为”1 ...

  10. hdu 3172 Virtual Friends (映射并查集)

    Virtual Friends Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)T ...