struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JOSE L MARTINEZ-AVIAL <jlm...@gmail.com>
Subject Re: Access result name from JSP
Date Tue, 11 Jun 2013 04:29:17 GMT
Actually, what I want is to get the result name returned by the action, not
the action name. Is there a simple way I can access the result from the JSP?


2013/6/11 Lukasz Lenart <lukaszlenart@apache.org>

> 2013/6/10 JOSE L MARTINEZ-AVIAL <jlmagc@gmail.com>:
> > Hi,
> >
> >    I have an action where all the possible results show the initial
> screen.
> > I do that by using a "*" result
> >
> >         <action name="DoPublishDocument" class=
> > "xxx.yyy.zzz.PublishDocument">
> >             <interceptor-ref name="my-stack">
> >             <result name="*"
> > type="tiles">customer.publish-document.screen</result>
> >         </action>
> >
> >  But I would like to do some distinction in the underlying JSP between
> the
> > diferent results, and for that I need to get the action result from the
> > JSP. Is there an easy way to get it?
>
> I think there isn't a simple way. You must write an interceptor which
> will set action name on the action, ie.
>
> public String intercept(ActionInvocation ai) {
>     Object action = ai.getAction();
>     if (action instanceof ActionNameAware){
>
> ((ActionNameAware)action).setActionName(ai.getProxy().getActionName());
>     }
> }
>
>
> Regards
> --
> Ɓukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message