You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by pankaj semwal <se...@gmail.com> on 2009/08/23 08:04:07 UTC
Intermittent Session Problems in Strut2.
Hi List,
I am facing a problem of session intermittent in
Strut2.In Distributed environment
when user A login and at the same time when user B login .The information
are sharing .I tried but did not find the solution.
Even the session Id are creating different for each user.
I am setting the session as :
Map session = ActionContext.getContext().getSession();
session.put("loginDetails", user);
Please tell me where i am wrong.
Please help me.
RE: Intermittent Session Problems in Strut2.
Posted by John Liptak <bi...@atdenver.com>.
I recommend using a tool like Fiddler or HttpWatch to see if your session
cookie is being messed with.
I have seen Apache proxy server 2.0 build 50 cache the cookie set command on
images etc.
So when you get a cached copy of an image you get the session that the other
user had when the image was cached.
You probably have a different issue, but since you don't have any other
details, I can't be more helpful.
John
-----Original Message-----
From: rohansd [mailto:rohan.desai@tcs.com]
Sent: Wednesday, September 09, 2009 8:47 PM
To: user@struts.apache.org
Subject: Re: Intermittent Session Problems in Strut2.
Even we am facing this problem with my application whe it runs on proxy
servers.
Apparently, this problem occurs only with a certain proxy server. There may
be rules defined on the proxy server but being an internet application we
have to live with it and find a solution.
The information that is shared comes from the database..
Interestingly, when the browser is refreshed the data shows up correctly.
we tried the no-cache as well as no-store stuff in jsps to no avail.
Any pointers will be greatly appreciated.
Thanks
Rohan
pankaj semwal wrote:
>
> Intermittent session problems come when our application runs on proxy
> servers.
> Even i put the cache remove tags in jsp.
>
> Still same problem i am facing.
>
> Thanks
>
>
--
View this message in context:
http://www.nabble.com/Intermittent-Session-Problems-in-Strut2.-tp25100607p25
376314.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: Intermittent Session Problems in Strut2.
Posted by j alex <st...@gmail.com>.
Are you using Spring to wire up the Action ? -- just a wild guess that the
bean scope may be Singleton (the default value) and that causes the data
sharing ?
2009/9/10 Paweł Wielgus <po...@gmail.com>
> Hi,
> i don't know if it will help but You can try same thing i did here [1]
> i was trying to force pages not to being cached and it turned out not
> to be trivial.
> Still i don't know how it will behave with proxy.
>
> [1]
> http://poulwiel.blogspot.com/2009/01/browser-back-button-and-caching-problem.html
>
> Best greetings,
> Paweł Wielgus.
>
>
> 2009/9/10 rohansd <ro...@tcs.com>:
> >
> > Even we am facing this problem with my application whe it runs on proxy
> > servers.
> > Apparently, this problem occurs only with a certain proxy server. There
> may
> > be rules defined on the proxy server but being an internet application we
> > have to live with it and find a solution.
> > The information that is shared comes from the database..
> > Interestingly, when the browser is refreshed the data shows up correctly.
> > we tried the no-cache as well as no-store stuff in jsps to no avail.
> > Any pointers will be greatly appreciated.
> > Thanks
> > Rohan
> >
> >
> >
> > pankaj semwal wrote:
> >>
> >> Intermittent session problems come when our application runs on proxy
> >> servers.
> >> Even i put the cache remove tags in jsp.
> >>
> >> Still same problem i am facing.
> >>
> >> Thanks
> >>
> >>
> >
> > --
> > View this message in context:
> http://www.nabble.com/Intermittent-Session-Problems-in-Strut2.-tp25100607p25376314.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
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Re: Intermittent Session Problems in Strut2.
Posted by Paweł Wielgus <po...@gmail.com>.
Hi,
i don't know if it will help but You can try same thing i did here [1]
i was trying to force pages not to being cached and it turned out not
to be trivial.
Still i don't know how it will behave with proxy.
[1] http://poulwiel.blogspot.com/2009/01/browser-back-button-and-caching-problem.html
Best greetings,
Paweł Wielgus.
2009/9/10 rohansd <ro...@tcs.com>:
>
> Even we am facing this problem with my application whe it runs on proxy
> servers.
> Apparently, this problem occurs only with a certain proxy server. There may
> be rules defined on the proxy server but being an internet application we
> have to live with it and find a solution.
> The information that is shared comes from the database..
> Interestingly, when the browser is refreshed the data shows up correctly.
> we tried the no-cache as well as no-store stuff in jsps to no avail.
> Any pointers will be greatly appreciated.
> Thanks
> Rohan
>
>
>
> pankaj semwal wrote:
>>
>> Intermittent session problems come when our application runs on proxy
>> servers.
>> Even i put the cache remove tags in jsp.
>>
>> Still same problem i am facing.
>>
>> Thanks
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Intermittent-Session-Problems-in-Strut2.-tp25100607p25376314.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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Intermittent Session Problems in Strut2.
Posted by rohansd <ro...@tcs.com>.
Even we am facing this problem with my application whe it runs on proxy
servers.
Apparently, this problem occurs only with a certain proxy server. There may
be rules defined on the proxy server but being an internet application we
have to live with it and find a solution.
The information that is shared comes from the database..
Interestingly, when the browser is refreshed the data shows up correctly.
we tried the no-cache as well as no-store stuff in jsps to no avail.
Any pointers will be greatly appreciated.
Thanks
Rohan
pankaj semwal wrote:
>
> Intermittent session problems come when our application runs on proxy
> servers.
> Even i put the cache remove tags in jsp.
>
> Still same problem i am facing.
>
> Thanks
>
>
--
View this message in context: http://www.nabble.com/Intermittent-Session-Problems-in-Strut2.-tp25100607p25376314.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: Intermittent Session Problems in Strut2.
Posted by pankaj semwal <se...@gmail.com>.
Intermittent session problems come when our application runs on proxy
servers.
Even i put the cache remove tags in jsp.
Still same problem i am facing.
Thanks
Re: Intermittent Session Problems in Strut2.
Posted by Dave Newton <ne...@yahoo.com>.
pankaj semwal wrote:
> private boolean isUserExist() {
> Connection con = null;
> boolean result = false;
>
> try {
> con = ConnectionFactory.getConnection();
>
> String sqlQ = "SELECT * FROM USER_MASTER WHERE LOGIN_ID=?"
> + "AND PASSWORD=? AND ROLE=? AND STATUS='Y'";
>
> PreparedStatement pstmt = con.prepareStatement(sqlQ);
> pstmt.setString(1, getUserId().trim());
> pstmt.setString(2, getPassword().trim());
> pstmt.setString(3, getRole().trim());
>
> ResultSet rst = pstmt.executeQuery();
> if (rst.next()) {
> user = new User();
> user.setUserId(rst.getInt("USER_ID") == 0 ? 0 : rst
> .getInt("USER_ID"));
> user.setUserName(rst.getString("USER_NAME") == null ? "" : rst
> .getString("USER_NAME"));
> user.setRole(rst.getString("ROLE") == null ? "" : rst
> .getString("ROLE"));
> user.setAddress(rst.getString("LOGIN_ID") == null ? "" : rst
> .getString("LOGIN_ID"));
> user.setCandidateId(rst.getString("CANDIDATE_ID") == null ? ""
> : rst.getString("CANDIDATE_ID"));
> user.setCustType(getCustType1() == null ? ""
> : getCustType1());
> result = true;
>
> getSession().put("loginDetails",user);*
> }
>
> And in other Actions i am getting the session as :
>
> User user = (User) getSession().get("loginDetails");
> if (user == null) {
> addActionMessage("Not Authorize to view this page.");
> return ERROR;
> }
>
> Is there any problem in this code.
Other than having a bunch of stuff in an action that should be in a
service, and some ugly code that should be refactored out, and
functionality that should be wrapped in an interceptor, I don't see
anything obvious.
Since it's intermittent I'd look first at the session sharing
config--it's almost certainly either something to do with that, or
something to do with how you're testing (trying from different browser
tabs, or different windows in a browser that shares sessions across
windows, etc).
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Intermittent Session Problems in Strut2.
Posted by mu...@aol.com.
Where is the information that is being shared? Your problem might
have nothing to do with authentication.
Chris
-----Original Message-----
From: pankaj semwal <se...@gmail.com>
To: Struts Users Mailing List <us...@struts.apache.org>
Sent: Mon, Aug 24, 2009 10:15 am
Subject: Re: Intermittent Session Problems in Strut2.
In my LoginAction i am setting the session as
private boolean isUserExist() {
Connection con = null;
boolean result = false;
// MD5Util MD5=new MD5Util();
try {
con = ConnectionFactory.getConnection();
String sqlQ = "SELECT * FROM USER_MASTER WHERE LOGIN_ID=?"
+ "AND PASSWORD=? AND ROLE=? AND STATUS='Y'";
PreparedStatement pstmt = con.prepareStatement(sqlQ);
pstmt.setString(1, getUserId().trim());
pstmt.setString(2, getPassword().trim());
pstmt.setString(3, getRole().trim());
ResultSet rst = pstmt.executeQuery();
if (rst.next()) {
user = new User();
user.setUserId(rst.getInt("USER_ID") == 0 ? 0 : rst
.getInt("USER_ID"));
user.setUserName(rst.getString("USER_NAME") == null ? "" : rst
.getString("USER_NAME"));
user.setRole(rst.getString("ROLE") == null ? "" : rst
.getString("ROLE"));
user.setAddress(rst.getString("LOGIN_ID") == null ? "" : rst
.getString("LOGIN_ID"));
user.setCandidateId(rst.getString("CANDIDATE_ID") == null ? ""
: rst.getString("CANDIDATE_ID"));
if (getCustType1() == null) {
user.setCustType("");
} else {
user.setCustType(getCustType1());
}
result = true;
* getSession().put("loginDetails",user);*
}
And in other Actions i am getting the session as :
User user = (User) getSession().get("loginDetails");
if (user == null) {
addActionMessage("Not Authorize to view this page.");
return ERROR;
}
AppointmentDocDBdao appointmentdocdob = new AppointmentDocDBdao();
custType = appointmentdocdob.getCustType(Integer.parseInt(user
.getCandidateId()));
Is there any problem in this code.
Re: Intermittent Session Problems in Strut2.
Posted by pankaj semwal <se...@gmail.com>.
In my LoginAction i am setting the session as
private boolean isUserExist() {
Connection con = null;
boolean result = false;
// MD5Util MD5=new MD5Util();
try {
con = ConnectionFactory.getConnection();
String sqlQ = "SELECT * FROM USER_MASTER WHERE LOGIN_ID=?"
+ "AND PASSWORD=? AND ROLE=? AND STATUS='Y'";
PreparedStatement pstmt = con.prepareStatement(sqlQ);
pstmt.setString(1, getUserId().trim());
pstmt.setString(2, getPassword().trim());
pstmt.setString(3, getRole().trim());
ResultSet rst = pstmt.executeQuery();
if (rst.next()) {
user = new User();
user.setUserId(rst.getInt("USER_ID") == 0 ? 0 : rst
.getInt("USER_ID"));
user.setUserName(rst.getString("USER_NAME") == null ? "" : rst
.getString("USER_NAME"));
user.setRole(rst.getString("ROLE") == null ? "" : rst
.getString("ROLE"));
user.setAddress(rst.getString("LOGIN_ID") == null ? "" : rst
.getString("LOGIN_ID"));
user.setCandidateId(rst.getString("CANDIDATE_ID") == null ? ""
: rst.getString("CANDIDATE_ID"));
if (getCustType1() == null) {
user.setCustType("");
} else {
user.setCustType(getCustType1());
}
result = true;
* getSession().put("loginDetails",user);*
}
And in other Actions i am getting the session as :
User user = (User) getSession().get("loginDetails");
if (user == null) {
addActionMessage("Not Authorize to view this page.");
return ERROR;
}
AppointmentDocDBdao appointmentdocdob = new AppointmentDocDBdao();
custType = appointmentdocdob.getCustType(Integer.parseInt(user
.getCandidateId()));
Is there any problem in this code.
Re: Intermittent Session Problems in Strut2.
Posted by Lukasz Lenart <lu...@googlemail.com>.
2009/8/24 pankaj semwal <se...@gmail.com>:
> I used SessionAware interface .Still i am facing the same problem.
It means, the problem is somewhere else. Without code is hard to guess
Regards
--
Lukasz
http://www.lenart.org.pl/
http://dailylog.lenart.org.pl/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Intermittent Session Problems in Strut2.
Posted by pankaj semwal <se...@gmail.com>.
Hi,
I used SessionAware interface .Still i am facing the same problem.
Re: Intermittent Session Problems in Strut2.
Posted by Lukasz Lenart <lu...@googlemail.com>.
2009/8/23 pankaj semwal <se...@gmail.com>:
> Please tell me where i am wrong.
You should use SessionAware interface instead (if you're doing that in
action) and the problem probably is in some other place, you must have
some global instance variable.
Regards
--
Lukasz
http://www.lenart.org.pl/
http://dailylog.lenart.org.pl/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Intermittent Session Problems in Strut2.
Posted by mu...@aol.com.
where is the information they are sharing located?
Chris
-----Original Message-----
From: Struts Two <st...@yahoo.ca>
To: Struts Users Mailing List <us...@struts.apache.org>
Sent: Sun, Aug 23, 2009 10:05 am
Subject: Re: Intermittent Session Problems in Strut2.
Do you log in to the system from two different client machines or you log in to
both accounts using tabs of a same browser IE or firefox ?
--- On Sun, 8/23/09, pankaj semwal <se...@gmail.com> wrote:
> From: pankaj semwal <se...@gmail.com>
> Subject: Intermittent Session Problems in Strut2.
> To: user@struts.apache.org
> Received: Sunday, August 23, 2009, 6:04 AM
> Hi List,
>
> ? ? ? ? ? ? ? ?
> ? ? ? ? ? I am facing a problem
> of???session intermittent in
> Strut2.In Distributed environment
>
> when user A login and at the same time when user B?
> login .The information
> are sharing .I tried but did not find the solution.
>
> Even the session Id? are creating different for each
> user.
>
> I am setting? the session as :
>
> Map session = ActionContext.getContext().getSession();
>
> session.put("loginDetails", user);
>
>
>
> Please tell me where i am wrong.
>
>
> Please help me.
>
__________________________________________________________________
Connect with friends from any web browser - no download required. Try the new
Yahoo! Canada Messenger for the Web BETA at http://ca.messenger.yahoo.com/webmessengerpromo.php
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Intermittent Session Problems in Strut2.
Posted by Struts Two <st...@yahoo.ca>.
Do you log in to the system from two different client machines or you log in to both accounts using tabs of a same browser IE or firefox ?
--- On Sun, 8/23/09, pankaj semwal <se...@gmail.com> wrote:
> From: pankaj semwal <se...@gmail.com>
> Subject: Intermittent Session Problems in Strut2.
> To: user@struts.apache.org
> Received: Sunday, August 23, 2009, 6:04 AM
> Hi List,
>
>
> I am facing a problem
> of session intermittent in
> Strut2.In Distributed environment
>
> when user A login and at the same time when user B
> login .The information
> are sharing .I tried but did not find the solution.
>
> Even the session Id are creating different for each
> user.
>
> I am setting the session as :
>
> Map session = ActionContext.getContext().getSession();
>
> session.put("loginDetails", user);
>
>
>
> Please tell me where i am wrong.
>
>
> Please help me.
>
__________________________________________________________________
Connect with friends from any web browser - no download required. Try the new Yahoo! Canada Messenger for the Web BETA at http://ca.messenger.yahoo.com/webmessengerpromo.php
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org