《struts2插件convention-plugin》.pdf

  1. 1、本文档共19页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
《struts2插件convention-plugin》.pdf

Convention Plugin  原文:/WW/convention­plugin.html  翻译:石太祥 (ealpha@    ) 1 Introduction 2 Setup 3 Converting a Codebehind based application to Convention 4 Hello world 5 Code behind hello world 6 Results and result codes 7 Chaining 8 XWork packages 9 Annotation reference  o  9.1 Action annotation  o  9.2 InterceptorRef annotation  o  9.3 Result annotation  o  9.4 Namespace annotation  o  9.5 ResultPath annotation  o  9.6 ParentPackage annotation  o  9.7 ExceptionMapping Annotation 10 Actions in jar files 11 Automatic configuration reloading 12 Troubleshooting  o  12.1 Tips  o  12.2 Common Errors 13 Configuration reference  Introduction  从 struts2.1版本开始,Convention Plugin 作为替换替换 Codebehind Plugin 来实现  Struts2 的零配置。 包命名习惯来指定 Action 位置 命名习惯制定结果(支持 JSP,FreeMarker 等)路径 类名到 URL 的约定转换 包名到命名空间(namespace)的约定转换 遵循 SEO 规范的链接地址 (即:使用 my­action 来替代 MyAction) 基于注解的 Action名 基于注解的拦截机(Interceptor) 基于注解的命名空间 (Nameespace) 基于注解的 XWork 包 默认 action 以及默认的结果(比如:/products 将会尝试寻找  com.example.actions.Products 或 ducts.Index  进行处理) 无需配置 Convention即可使用 Convention,Co  nvention 的某些约束习惯可以通过配置 属性来控制,您也可以在类中覆写其中的方法来达到扩展目地。 安装 使用 Convention 插件,你需要将其 JAR 文件放到你应用的 WEB­INF/lib 目录中,你也 可以在你 Macen项目的 POM 文件中添加下面包依赖 dependency groupIdorg.apache.struts/groupId artifactIdstruts2-convention-plugin/artifactId version2.1.6/version /dependency 转换基于 Codebehind项目到 Convention  跳转到此页面,查看需要修改的变化和小提示 如果你想在你系统中结合 Convention 插件使用 REST。需要在你项目的 struts.xml 中添 加如下配置 constant name struts.convention

文档评论(0)

wgvi + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档