You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Daniel Rindt <dr...@visetics.com> on 2010/09/15 23:45:02 UTC

few questions

Hello,

i would like to know how to obtain the name of the current action inside
the JSP code. I found code: <s:property value="%{#action}" /> but this
is showing me: "action.Register@ce41cc" but its useless information for
me.

next question i had is i invoke a request to any action like this:
"?request_locale=tr", the form i use on that page immediately changes
the labels for the fields as expected. But it seems that the code inside
the action is not understanding this. Because the prepare() method makes
use of getText() and this translation is also not processed, it remains
in the language what struts initially detected.

Hopefully someone can give me a lil clue.
TIA
Daniel

Re: few questions

Posted by Greg Lindholm <gr...@gmail.com>.
You can get the action name in a JSP with
"#context['struts.actionMapping'].name".
What I do is to add a getActionName() to the action base class which
returns ActionContext.getContext().getName()



On Wed, Sep 15, 2010 at 5:45 PM, Daniel Rindt <dr...@visetics.com> wrote:
> Hello,
>
> i would like to know how to obtain the name of the current action inside
> the JSP code. I found code: <s:property value="%{#action}" /> but this
> is showing me: "action.Register@ce41cc" but its useless information for
> me.
>
> next question i had is i invoke a request to any action like this:
> "?request_locale=tr", the form i use on that page immediately changes
> the labels for the fields as expected. But it seems that the code inside
> the action is not understanding this. Because the prepare() method makes
> use of getText() and this translation is also not processed, it remains
> in the language what struts initially detected.
>
> Hopefully someone can give me a lil clue.
> TIA
> Daniel
>

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