@Result(name = IndexAction.SUCCESS,
type = "redirectAction",
location = "word",
params = {"namespace", "/site/message/word",
"mid" , "${mid}"})
})
public class ToggleTopAction extends DrivenBase {
置顶方法:
//自定义一个testMid遍量,用来接受参数
private Long testMid ;
/**
*
* 自定义一个testMid遍量,用来接受参数
*/
public Long getMid() {
return this.testMid;
}
@Override
public String getSuccessPath(){
return "/site/message/word/word?mid="
+ServletActionContext.getRequest().getParameter("mid");
}
@Override
public String getReturnPath(){
return "/site/message/word/word?mid="
+ServletActionContext.getRequest().getParameter("mid");
}
执行的方法下
@Override
public String execute(){
// 资源检验
/* System.out.println(" mid : "+((SiteMessageWordParams)params).getMid()+" == id "
+params.getId() );*/
// 通过赋值把testMid 传给了getMid()的方法,使得mid取得到值
this.testMid = getMid();
target = targetBiz.load(params.getId());
/* if(target == null)
return ERROR;
*/