struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yasser Zamani <yasserzam...@apache.org>
Subject Re: Struts2 login action class seems to be reused
Date Tue, 24 Apr 2018 06:52:41 GMT


On 4/23/2018 11:50 PM, Prasanth Pasala wrote:
> Get rid of the get methods in LoginAction, is this in /Context2 (application where the
issue is occurring) or /Context1 (which forwards the requests to /Context2)?
> 

That contexts who forwards request (Context1 I think) but you may do for
all to be sure. However, I still prefer rewriting FORWARD with REDIRECT
or POSTBACK to prevent future possible issues.

> 
> Yes exactly. The new log shows, your previous contexts actions
> (LoginAction@7f716c46 and LoginAction@35224c2f) are also present in
> current context because you forward same request which includes previous
> context data, then, Struts ChainInterceptor copies data from previous to
> current action :S . As currently Struts cannot handle forwarded requests
> well, could you please try REDIRECT instead? sendRedirect asks user
> browser to continue with a new request.
> 
> Still not sure about the above comment.  So the ChainInterceptor is getting data from
an action that occurred before and is not part of current request?

Struts has a stack. ChainResult push current action to stack for next
action. In next action, ChainInterceptor pops it and copies values. Now
you have two actions in stack (I don't know how but seems it's because
of forward same request which has previous context1 stack) and
ChainInterceptor thinks ChainResult has pushed that and then pops and
copies them into current action.

Regards.

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