I'm skeptical this is the best approach, especially considering you can
just expose an action property and accomplish the same thing. You could
even use that property to define the result name.

Dave



On Tue, Jun 11, 2013 at 1:39 AM, Chris Pratt <thechrispr...@gmail.com>wrote:

> That's what the invocation.invoke() method returns.  It's either the result
> name from the action, or one of the interceptors that took control (after
> your interceptor).  Either way, it's the result that will be used to return
> the result.
>   (*Chris*)
>
>
> On Mon, Jun 10, 2013 at 9:29 PM, JOSE L MARTINEZ-AVIAL <jlm...@gmail.com
> >wrote:
>
> > 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 <lukaszlen...@apache.org>
> >
> > > 2013/6/10 JOSE L MARTINEZ-AVIAL <jlm...@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-unsubscr...@struts.apache.org
> > > For additional commands, e-mail: user-h...@struts.apache.org
> > >
> > >
> >
>



-- 
e: davelnew...@gmail.com
m: 908-380-8699
s: davelnewton_skype
t: @dave_newton <https://twitter.com/dave_newton>
b: Bucky Bits <http://buckybits.blogspot.com/>
g: davelnewton <https://github.com/davelnewton>
so: Dave Newton <http://stackoverflow.com/users/438992/dave-newton>

Reply via email to