首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

struts2不再推荐应用Codebehind作为零配置插件

2012-07-02 
struts2不再推荐使用Codebehind作为零配置插件package com.fun.actionsimport org.apache.struts2.conven

struts2不再推荐使用Codebehind作为零配置插件


package com.fun.actions; import org.apache.struts2.convention.annotation.Action; import org.apache.struts2.convention.annotation.Actions; import com.fun.service.LoginService; import com.opensymphony.xwork2.ActionSupport; public class LoginAction extends ActionSupport { private String str; @Actions({ @Action(value="login1",params={"str","这是已经注入的了!"}), @Action(value="login2") }) public String login(){ return "str"; } @Action(value="ggg") public String abc(){ return "abc"; } public String getStr() { return str; } public void setStr(String str) { this.str = str; } } ?

@InterceptorRef用于为指定Action引用lanjieq或者是拦截器栈。也就相当于strut.xml中位于<action../>元素内部的<interceptor-ref../>子元素的作用。使用@InterceptorRefAnnotation时,必须制定一个value属性,用于指定所引用的拦截器或拦截器栈的名字。相当于<interceptor-ref../>子元素里name属性的作用。

?

热点排行