struts2里struts.xml配置文件的的片段:
action里写法:
<global-results>
<result name="pagepath">${pagepath}</result>
<result name="pagepathaction" type="redirect">${pagepathaction}</result>
</global-results>
action里写法:
protected String pagepath = "";
protected String pagepathaction = "";
public final String PAGEPATH = "pagepath";
public final String PAGEPATHACTION = "pagepathaction";
public String getPagepathaction() {
return pagepathaction;
}
public void setPagepathaction(String pagepathaction) {
this.pagepathaction = pagepathaction;
}
public String getPagepath() {
return pagepath;
}
public void setPagepath(String pagepath) {
this.pagepath = pagepath;
}public String returnpagepath() throws Exception
{
this.pagepath = "/success.jsp";
return PAGEPATH;
}