Struts2 dynamic parameter name in redirect-action

后端 未结 2 635
闹比i
闹比i 2021-01-06 16:29

I\'m successfully using a redirect-action for one of my struts2 mapping files as follows:

         


        
相关标签:
2条回答
  • 2021-01-06 17:09

    Actually, that doesn't work. However, I was able to get this working doing the following:

    <action name="setAsCurrentCart" class="com.fmp.MyAction">
       <result name="success" type="redirect-action">
          <param name="actionName">myOtherAction</param>
          <param name="${dynamicParameterName}">${dynamicParameterValue}</param>
       </result>
    </action>
    

    I had just assumed it wouldn't work.

    0 讨论(0)
  • 2021-01-06 17:24

    could you do this instead?

    <action name="setAsCurrentCart" class="com.fmp.MyAction">
       <result name="success" type="redirect-action">
          <param name="actionName">myOtherAction</param>
          <param name="paramName">${dynamicParameterName}</param>
          <param name="paramValue">${dynamicParameterValue}</param>
       </result>
    </action>
    
    0 讨论(0)
提交回复
热议问题