Action:
public String info(){
 String str="XXX";        
 return str+"info";
}xml:
<result name=xxx"info">
/xxx_info.jsp
        </result>希望实现,通过str跳转到不同的页面,如str="a"则跳转到a_info.jsp,str="b"则跳转到b_info.jsp,
请问一下应该怎么写

解决方案 »

  1.   

    建议用通配符做配置   <action name=“*_*”class="com.xxx.{1}Action" method="{2}"><result>{1}_{2}_success.jsp </result></action>
      

  2.   

    做出来了,没有用通配符
    现在用的是 OGNL动态配置
    具体的做法如下:<result name="export_detail">
    /${resultname}_info.jsp
    </result>其中resultname是Action中定义的一个属性值,在Action中改变该属性值并配置了相应的页面,就可以跳转到不同的界面了
      

  3.   

    <result name=xxx"info">
    你的要求不是这样吗?