Struts动态结果集
我们可以在action中动态指定结果集的location,其实就是在struts.xml文件中拿到action的属性而已。
UserAction
public class UserAction extends ActionSupport
{
private String path;
private String type;
public String execute()
{
if(type == "1")
{
path = "xy.jsp";
}
else path = "xy2.jsp";
return success;
}
}
Getter和Setter省略
Struts.xml
<action name="uaction" >
<result>${path}</result>
</action>
简单吧。
最后更新:2017-04-02 16:47:54