You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Andvar Woo <an...@gmail.com> on 2007/10/26 12:17:22 UTC

Struts2 redirect-action params with ognl-expression values

Hi.all.
Recently,I'v encounter a problem.
The problem comes as follows:
 *First invoke a MdfNews Action with a news id param to init some
variables,then goes*
*to a newsModify.jsp page ,something like
http://www.comanyName.com/news/MdfNews.action?id=123*

<action name="MdfNews"
   class="com.forlink.wps.news.action.NewsMdfAction">
   <result name="success">/WEB-INF/template/newsinfo/newsModify.jsp</result>
   <result name="error">/WEB-INF/template/newsinfo/error.jsp</result>
  </action>
*then modify the news info,post info to MdfNewsInfo Action*
<action name="MdfNewsInfo"
   class="com.forlink.wps.news.action.NewsMdfInfoAction">
   <interceptor-ref name ="fileUploadStack">
    <param name="maximumSize">10485760</param>
   </interceptor-ref>
    <interceptor-ref name="defaultStack"/>
   <result name="success" type="redirect">List.action</result>
<!--
*if you upload a attachment whose size exceeds 10M,then goes to "input"
result;but the id param*
*passed couldnot be assigned value of the "${id}" expression*
*-->*
   <result name="input" type="redirect-action">
                ModNews.action?id=${id}
         </result>
  </action>
*The id value got at ModNews.action is nothing,not even 0.*
*Does anyone hnows why?Many Thanks*

RE: Struts2 redirect-action params with ognl-expression values

Posted by "LEONARD Julien (Consulting for ACCOR Hotels)" <ju...@consulting-for.accor.com>.
Did you try this ?

<result name="input" type="redirect-action">
	<param name="actionName">ModNews</param>
	<param name="id">${id}</param>
</result> 

Julien

-----Message d'origine-----
De : Andvar Woo [mailto:andvar2008@gmail.com] 
Envoyé : vendredi 26 octobre 2007 12:17
À : Struts Users Mailing List
Objet : Struts2 redirect-action params with ognl-expression values

Hi.all.
Recently,I'v encounter a problem.
The problem comes as follows:
 *First invoke a MdfNews Action with a news id param to init some variables,then goes* *to a newsModify.jsp page ,something like
http://www.comanyName.com/news/MdfNews.action?id=123*

<action name="MdfNews"
   class="com.forlink.wps.news.action.NewsMdfAction">
   <result name="success">/WEB-INF/template/newsinfo/newsModify.jsp</result>
   <result name="error">/WEB-INF/template/newsinfo/error.jsp</result>
  </action>
*then modify the news info,post info to MdfNewsInfo Action* <action name="MdfNewsInfo"
   class="com.forlink.wps.news.action.NewsMdfInfoAction">
   <interceptor-ref name ="fileUploadStack">
    <param name="maximumSize">10485760</param>
   </interceptor-ref>
    <interceptor-ref name="defaultStack"/>
   <result name="success" type="redirect">List.action</result>
<!--
*if you upload a attachment whose size exceeds 10M,then goes to "input"
result;but the id param*
*passed couldnot be assigned value of the "${id}" expression*
*-->*
   <result name="input" type="redirect-action">
                ModNews.action?id=${id}
         </result>
  </action>
*The id value got at ModNews.action is nothing,not even 0.* *Does anyone hnows why?Many Thanks*


This e-mail, any attachments and the information contained therein ("this message") are confidential and intended solely for the use of the addressee(s). If you have received this message in error please send it back to the sender and delete it. Unauthorized publication, use, dissemination or disclosure of this message, either in whole or in part is strictly prohibited.
--------------------------------------------------------------------------------------------------------------
Ce message électronique et tous les fichiers joints ainsi que  les informations contenues dans ce message ( ci après "le message" ), sont confidentiels et destinés exclusivement à l'usage de la  personne à laquelle ils sont adressés. Si vous avez reçu ce message par erreur, merci  de le renvoyer à son émetteur et de le détruire. Toutes diffusion, publication, totale ou partielle ou divulgation sous quelque forme que se soit non expressément autorisées de ce message, sont interdites.
-------------------------------------------------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org