struts2 从action跳转至action中解决方案
struts2 从action跳转至action中
假设,我在 A action中做的业务有个map对面是查询数据的,我通过查询取出数据量如果大于1000就要跳转至 B action中执行导出,否则继续执行A。请问这该怎么做。
------解决方案--------------------
这个很简单啊,写两个result就行了吧。。
if(...){
return "one";
}else{
return "two";
}
<action>
<result name="one" type="redirectAction">x1.action</result>
<result name="two" type="redirectAction">x2.action</result>
</action>
假设,我在 A action中做的业务有个map对面是查询数据的,我通过查询取出数据量如果大于1000就要跳转至 B action中执行导出,否则继续执行A。请问这该怎么做。
Map<String,List<Object>> map = new HashMap<String,List<Object>>() ;
if(map.get("result").size()>1000){
跳转至 B action......
}
------解决方案--------------------
这个很简单啊,写两个result就行了吧。。
if(...){
return "one";
}else{
return "two";
}
<action>
<result name="one" type="redirectAction">x1.action</result>
<result name="two" type="redirectAction">x2.action</result>
</action>