You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "jignesh.patel" <ji...@aspl.in> on 2008/02/27 05:41:52 UTC

Context problem in struts2

Hi,
    I am having struts2 application,whenever i am doing action redirect i am
getting new context instead of old one ?

<result name="login" type="redirect">../authentication/login.action</result>
or
<result name="login" type="redirect-action">

login

</result>

And context log looks like ...
com.opensymphony.xwork2.ActionContext.getContext()


-- 
View this message in context: http://www.nabble.com/Context-problem-in-struts2-tp15705966p15705966.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Context problem in struts2

Posted by Laurie Harper <la...@holoweb.net>.
jignesh.patel wrote:
> Hi,
>     I am having struts2 application,whenever i am doing action redirect i am
> getting new context instead of old one ?
> 
> <result name="login" type="redirect">../authentication/login.action</result>
> or
> <result name="login" type="redirect-action">
> 
> login
> 
> </result>
> 
> And context log looks like ...
> com.opensymphony.xwork2.ActionContext.getContext()

A redirect tells the browser to make a new HTTP request. Since it's a 
new request, it needs a new context. What are you trying to do?

L.


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


Re: Context problem in struts2

Posted by Dave Newton <ne...@yahoo.com>.
The JavaDocs for ActionContext.getLocale() states that it returns the locale
of the current action.

IIRC the I18N interceptor also puts the locale into the session.

The JavaDocs and the source are your friends.

Dave

--- "jignesh.patel" <ji...@aspl.in> wrote:

> 
> I am using locale from the context for the whole application.
> As i am having application with three localization.
> 
> Once the context changed it gives me the default locale instead of the
> previous one i have selected.
> 
>
com.opensymphony.xwork2.ActionContext.ActionContext.getContext().getLocale()
> 
> 
> Is there any way so i can get the same locale until i change the request
> parameter (request_locale=x)?
> 
> Thanks.
> 
> 
> jignesh.patel wrote:
> > 
> > Hi,
> >     I am having struts2 application,whenever i am doing action redirect i
> > am getting new context instead of old one ?
> > 
> > ../authentication/login.action
> > or
> > 
> > 
> > login
> > 
> > 
> > 
> > And context log looks like ...
> > com.opensymphony.xwork2.ActionContext.getContext()
> > 
> > 
> > 
> 
> -- 
> View this message in context:
> http://www.nabble.com/Context-problem-in-struts2-tp15705966p15751758.html
> Sent from the Struts - User mailing list archive at Nabble.com.
> 


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


Re: Context problem in struts2

Posted by "jignesh.patel" <ji...@aspl.in>.
I am using locale from the context for the whole application.
As i am having application with three localization.

Once the context changed it gives me the default locale instead of the
previous one i have selected.

com.opensymphony.xwork2.ActionContext.ActionContext.getContext().getLocale()


Is there any way so i can get the same locale until i change the request
parameter (request_locale=x)?

Thanks.


jignesh.patel wrote:
> 
> Hi,
>     I am having struts2 application,whenever i am doing action redirect i
> am getting new context instead of old one ?
> 
> ../authentication/login.action
> or
> 
> 
> login
> 
> 
> 
> And context log looks like ...
> com.opensymphony.xwork2.ActionContext.getContext()
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Context-problem-in-struts2-tp15705966p15751758.html
Sent from the Struts - User mailing list archive at Nabble.com.