`
wotf23771
  • 浏览: 34150 次
  • 性别: Icon_minigender_1
  • 来自: 邯郸
社区版块
存档分类
最新评论

含有convention插件的struts.xml文件

阅读更多
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN"
        "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<constant name="struts.locale" value="zh_CN" />
<constant name="struts.i18n.encoding" value="UTF-8" />
<constant name="struts.convention.result.path" value="/WEB-INF/pages/" />

<constant name="struts.convention.default.parent.package"
value="crud-default" />
<constant name="struts.convention.package.locators" value="web" />
<constant name="struts.convention.action.name.lowercase"
value="true" />
<constant name="struts.convention.action.name.separator"
value="_" />
<constant name="struts.multipart.maxSize" value="4000000000" />

<!-- 用于CRUD Action的parent package -->
<package name="crud-default" extends="convention-default,json-default">
<!--
基于paramsPrepareParamsStack, 增加store
interceptor保证actionMessage在redirect后不会丢失
-->
<interceptors>
<interceptor-stack name="crudStack">
<interceptor-ref name="store">
<param name="operationMode">AUTOMATIC</param>
</interceptor-ref>
<interceptor-ref name="defaultStack" />
</interceptor-stack>
</interceptors>

<default-interceptor-ref name="crudStack" />
<global-results>
<result name="executeResult" type="freemarker">/commons/execute_result.ftl</result>
<result name="exception" type="freemarker">/commons/exception.ftl</result>
</global-results>
</package>

<!--
使用Convention插件,实现约定大于配置的零配置文件风格. 特殊的Result路径在Action类中使用@Result设定.
-->
</struts>
分享到:
评论

相关推荐

    struts2的rest风格插件实例

    通过 struts.xml、struts.properties 或 web.xml 改变 struts.convention.default.parent.package 常量的值,让支持 REST 风格的 Action 所在的包默认继承 rest-default,而不是继承默认的 convention-default 父包...

    STRUTS2 Convention零配置

    从struts2.1开始,struts2不再推荐使用Codebehind作为零配置插件,而是改为使用Convention插件来支持零配置,和Codebehind相比,Convention插件更彻底,该插件完全抛弃配置信息,不仅不需要是使用struts.xml文件进行...

    struts2零配置个人整理文档

    1 Convention插件 1.1 设置结果页面路径 默认所有的结果页面都存储在WEB-INF/content下,你可以通过设置struts.convention.result.path这个属性的值来改变到其他路径。如: Xml代码 &lt;constant name="struts....

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

    本书内容非常全面,涵盖了众多书籍所有知识要点,并结合作者自己经验总结而编写,内容相当丰富,是查找技术的好帮手及学习Struts2的不二选择 众所周知,一般书籍为了销售...插件_convention .....插件_config-browser

    struts2-convention-plugin-2.1.6.jar

    Struts2 的第三方插件 使用注解的方式配置struts.xml文件

    Struts2-rest插件(有注释)

    Convention 插件彻底地抛弃了配置信息,不仅不需要使用 struts.xml 文件进行配置,甚至不需要使用 Annotation 进行配置。而是由 Struts 2 根据约定来自动配置。 Convention 这个单词的翻译过来就是“约定”的意思。...

    struts2注解详细说明

    安装使用Convention插件,你需要将其JAR文件放到你应用的WEB-INF/lib目录中,你也可以在你Macen项目的POM文件中添加下面包依赖      &lt;groupId&gt;org.apache.struts   &lt;artifactId&gt;struts2-convention-plugin   ...

    struts2零配置convention-plugin

    从struts2.1开始,struts2不再推荐使用Codebehind作为零配置插件,而是改为使用Convention插件来支持零配置,和Codebehind相比,Convention插件更彻底,该插件完全抛弃配置信息,不仅不需要是使用struts.xml文件进行...

    Struts2注解使用说明文档

    从struts2.1开始,struts2不再推荐使用Codebehind作为零配置插件,而是改为使用Convention插件来支持零配置,和Codebehind相比,Convention插件更彻底,该插件完全抛弃配置信息,不仅不需要是使用struts.xml文件进行...

    struts2注解使用.doc

    从struts2.1开始,struts2不再推荐使用Codebehind作为零配置插件,而是改为使用Convention插件来支持零配置,和Codebehind相比,Convention插件更彻底,该插件完全抛弃配置信息,不仅不需要是使用struts.xml文件进行...

    struts2注解详解

    从struts2.1开始,struts2不再推荐使用Codebehind作为零配置插件,而是改为使用Convention插件来支持零配置,和Codebehind相比,Convention插件更彻底,该插件完全抛弃配置信息,不仅不需要是使用struts.xml文件进行...

    struts2.1.6+spring2.0+hibernate3.2常用配置包

    spring版本有2.0,2.5的,hibernate版本较多些至3.2,首先选版本就选择最优的,struts2没的选只有2.1.6版的,所以先导入struts2支持,然后是spring选的是2.0,问题就出在struts2中spring的插件上了,没有从MyEclipse...

Global site tag (gtag.js) - Google Analytics