struts-annotations-plugin 介绍
来源:互联网 发布:平安达电子狗升级软件 编辑:程序博客网 时间:2024/05/04 21:20
下载:http://code.google.com/p/struts-annotations-plugin/downloads/list
- Exposing an Action and an ActionForm
/** * The path to this action will be "/searchBookAction" if no path * it's specified. */ @Action(form=BookForm.class) public class SearchBookAction extends Action { .... } /** * The name used by Struts to save this form into * Request or Session will be "bookForm" if no name * it's specified. */ @Form public class BookForm extends Form { }
- Exposing an Action with a forward
/** * The path to this action will be "/searchBook". The "/" character * it's optional. * The @Forward annotation it's used to configure the action forward. If * more forwards are needed, then use @Forwards annotation. * If both annotations are present, the @Forward annotation has higher priority. */ @Action(path="/searchBook", form=BookForm.class) @Forward(name="success", path="/pages/main.jsp") public class SearchBookAction extends Action { .... }
- Exposing an Action with many forwards
/** * The path to this action will be "/searchBook". The "/" character * it's optional. */ @Action(path="/searchBook", form=BookForm.class) @Forwards({ @Forward(name="success", path="/pages/main.jsp") @Forward(name="error", path="/pages/error.jsp") }) public class SearchBookAction extends Action { .... }
- A little more complex (?) example
@Action(path="/searchBook", form=BookForm.class) @Input("/pages/login.jsp") @Forwards({ @Forward(name="success", path="/pages/main.jsp") @Forward(name="error", path="/pages/error.jsp") }) @SetProperties({ @Property(property="checkLogin" value="true"), @Property(property="checkRoles" value="true") }) @Validate public class SearchBookAction extends Action { .... }
- What about a DispatchAction....?
/** * The @Dispatch annotation tells the name of the parameter to be used * to identify the method to be invoked by Struts. The @Parameter also * works. The @Dispath annotation exists only for making the code more readable. */ @Action(form=BookForm.class) @Dispatch("action") @Input("/pages/bookList.jsp") @Forward(name="success", path="/pages/main.jsp") public class CheckBookAction extends DispatchAction { ... }
- I have a lot of dynamic forms....
/** * By just annotating a form bean with @Form and @FormProperties * annotations, the form bean it's processed as a dynamic form. * Note that the real power of dynamic forms it's losted here. * Configuration directly on struts-config.xml it's highly recomended for this cases. */ @Form @FormProperties({ @FormProperty(name="name", type=String.class), @FormProperty(name="age", type=Integer.class), @FormProperty(name="adress", type=String.class) }) public class MyBaseDynaForm extends DynaActionForm { ... }
另一个实现:http://code.google.com/p/struts-annotations/
- struts-annotations-plugin 介绍
- Struts 2 Annotations Types
- Struts 2 Annotations
- Struts 2 Annotations
- Android Annotations 介绍
- tapestry注释介绍Annotations
- tapestry注释介绍Annotations
- Android Annotations 介绍
- tapestry注释介绍Annotations
- Android Annotations 介绍
- Struts 2 plugin architecture
- struts-plugin.xml
- struts-plugin.xml
- struts convention-plugin
- struts-plugin resulttype 参数
- struts convension plugin
- struts plugIn的作用
- Annotations
- 锐拜:用在 Ajax 流行时!动态消息弹窗之 Dmwindow
- 用Diff和Patch工具维护源码
- i-doser下载与在线试听
- 杀毒软件使用技巧【精华】
- 八皇后问题回溯算法演示系统
- struts-annotations-plugin 介绍
- pku 2777 Count Color(线段树变形)
- 大对象数据的访问控制 (2)
- 为什么开发人员对Ada不感兴趣?
- Eclipse建模框架(EMF)及其动态能力
- 每日英语-7/26/2009
- 可用于制药产品生产的多功能发酵罐
- 每个人都是一部小说,只是没有梳理
- NBS Bioflo IV自控发酵罐