|
Project Information
Featured
Downloads
|
Overviewstruts2-coc-plugin is struts2 plugin that based on Conversion plugin.It do some coding optimization and coding conversion,such as the mapper of URI and action method、file upload handle、json/text result response、validation input result redefined、action message populate after redirect and so on.The main purpose of struts2-coc-plugin is to help developer to develop with zero configuration but still keep the structure of project clearly and maintain easily! struts2-coc-plugin是一款基于Conversion插件的struts2插件,该插件主要在conversion插件基础上优化了部分处理流程,比如uri地址和action方法的映射、文件上传的处理、json/text文本输出的处理、校验和操作提示信息的处理等等。该插件的唯一目的就是真正的不进行一行配置,同时可以保持项目结构的清晰便于开发维护。 Resources1.Author's blog:http://www.mzone.cc Featuresstruts2-coc-plugin is a plugin base on Conversion plugin,it handle some thing to coding optimization and conversion as following: 1.every action can service multiple request with simple uri struts2-coc-plugin是一个基于Conversion插件的struts2插件,该插件主要做了如下优化和约定开发: 1.每个action可以支持多个访问入口,使用普通的uri即可访问 Usage1.Download latest artifact from http://code.google.com/p/struts2-coc-plugin/downloads/list 2.Download Convention plugin from https://cwiki.apache.org/S2PLUGINS/convention-plugin.html 3.Add these artifacts to your web application library dependencies or to your maven repository if you use maven manage your project 4.Configure the struts.properties and add following segments: ### +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ### + convertion 插件的配置 ### + 参看http://struts.apache.org/2.x/docs/convention-plugin.html ### +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ### 配置视图结果页面的路径,默认是 /WEB-INF/content struts.convention.result.path=/WEB-INF/content ### 指示是否将视图页面单独放置在以action命名的文件夹中,默认不是(true) #struts.convention.result.flatLayout=true ### 指定搜索Action的包路径中包含的名称,默认是action,actions,struts,struts2 ### 如下配置则表示所有包路径中包含 actions的包及其子包中进行搜索Action ### 搜索Action的规则是:Action接口的实现类和以Action作为名称结尾的类 struts.convention.package.locators=actions ### 指定包含了Action的jar文件的正则式,多个以逗号分隔 #struts.convention.action.includeJars= ### 指定当基于名称来查找Action时的类名的结尾部分,默认是Action #struts.convention.action.suffix=Action ### 指定默认的parent package,默认是convention-default struts.convention.default.parent.package=coc-default ### 指定action的名称、视图名称的分隔符,默认是- #struts.convention.action.name.separator=- ### 支持rest插件和coc插件 struts.convention.action.mapAllMatches=true ### +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ### + struts2-coc-plugin 插件的配置 ### +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ### action的默认方法,默认是index #struts.coc.defaultMethod=index ### 对于存在的处理器,是否限制访问后缀和方法注解必须一致才执行,默认false struts.coc.requestLimited=false ### 如果访问的方法不存在于action中是否将方法名称作为result返回,默认true #struts.coc.methodNameAsResult=true ### 是否处理action的message和error消息,默认true #struts.coc.handleMessage=true 5.Coding with struts2-coc-plugin: public class TestAction extends CocActionSupport {
/**
* request URI is:/test/index
*/
public String index() {
return "index";
}
/**
* request URI is:/test/list
*/
public String list() {
return "list";
}
}ExampleThe whole documents and examples you can find here:http://code.google.com/p/struts2-coc-plugin/w/list Or visit the author's blog to see more details:[铁木箱子 http://www.mzone.cc] SettingsThe following settings can be customized.
InstallationThis plugin can be installed by copying the plugin jar into your application's {{/WEB-INF/lib}} directory. No other files need to be copied or created. Version History
|