Re: http session lost between struts action

2005-06-27 Thread angelina zh
Jack,
 
I dont understand why you keep saying there is nothing worng. The session got 
established at the log in page and kept valid in the security re-diredct pages 
till the welcome page. Then session got lost. Why there is nothing wrong with 
it?
 
The session id did not get lost, just the http session lost.
 
Regards,
 
Angelina

Dakota Jack [EMAIL PROTECTED] wrote:
There is nothing wrong. You don't have a new session in your browser.

On 6/23/05, angelina zh wrote:
 Hi,
 
 Can anyone please help me on this session lost issue?
 
 Here is the problem I am getting:
 
 -- If I open a IE 6.0 browser and log into the web site we are developing, I 
 get into a welcome page with a few of link options. In the login action 
 class, we set some attributes into the session. If I click on any of the 
 links, I got null pointer exception in next action class when we try to get 
 attributes from the session. I tried to use Eclipse to debug, noticed that 
 the session of the request after the welcome page became to null.
 
 --If I keep that browser open and go to the log in page again. After I log 
 in, I get into the welcome page and if I click any of the links now, the 
 session of the request is not null and I can go to any links without any 
 problem. The null pointer did not occur in the following action class.
 
 --If I close the browser then open browser again, I get NullPointerException 
 again if I repeat those steps.
 
 What might be wrong?
 
 Thanks so much in advance.
 
 Angelina
 
 
 
 -
 Yahoo! Sports
 Rekindle the Rivalries. Sign up for Fantasy Football
 


-- 
You can lead a horse to water but you cannot make it float on its back.
~Dakota Jack~

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: http session lost between struts action

2005-06-27 Thread David Smith

Check these:

1. Your browser is accepting cookies
2. Your links are being generated by taglibs that insure the jsessionid 
is attached if needed.  I say if needed because if tomcat is getting a 
valid session cookie from your browser, the jsessionid won't be added to 
the link.


They don't both have to be done, but chances of eliminating errors are 
best if they are.  Beyond that, I would have to suspect the way you are 
trying to access the session attributes either in setting them or in 
retrieving them.  Could you post code snippets that show how you are 
setting and retrieving attributes?


--David

angelina zh wrote:


Jack,

I dont understand why you keep saying there is nothing worng. The session got 
established at the log in page and kept valid in the security re-diredct pages 
till the welcome page. Then session got lost. Why there is nothing wrong with 
it?

The session id did not get lost, just the http session lost.

Regards,

Angelina

Dakota Jack [EMAIL PROTECTED] wrote:
There is nothing wrong. You don't have a new session in your browser.

On 6/23/05, angelina zh wrote:
 


Hi,

Can anyone please help me on this session lost issue?

Here is the problem I am getting:

-- If I open a IE 6.0 browser and log into the web site we are developing, I 
get into a welcome page with a few of link options. In the login action class, 
we set some attributes into the session. If I click on any of the links, I got 
null pointer exception in next action class when we try to get attributes from 
the session. I tried to use Eclipse to debug, noticed that the session of the 
request after the welcome page became to null.

--If I keep that browser open and go to the log in page again. After I log in, 
I get into the welcome page and if I click any of the links now, the session of 
the request is not null and I can go to any links without any problem. The null 
pointer did not occur in the following action class.

--If I close the browser then open browser again, I get NullPointerException 
again if I repeat those steps.

What might be wrong?

Thanks so much in advance.

Angelina



-
Yahoo! Sports
Rekindle the Rivalries. Sign up for Fantasy Football

   




 




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: http session lost between struts action

2005-06-27 Thread delbd
Don't know if it is related, but a note on an issue in session tracking we got 
here (an how we soluced it)

We got the following scenario:
1) someone get a link to a struts form in an email
2) He get to the page by clicking on link
3) The page is in a 'secure' area, meaning he gets a popup from browser for the 
basic-auth
4) User login in and see the form (This is the first time tomcat send a webpage 
in this session)
5) User fills the form and submit
6) in the Action, request.getUserPrincipal() returns null

Diagnostic: session is lost at the second request (that is when tomcat will 
check if cookies is supported)

Reason: it seems tomcat does not parse the ;JSESSIONID= par of url when the 
form is multipart (for file uploads)

Solution: have to user go to an intermediate redirect page before *and* have 
the browser with cookies enabled

Le Lundi 27 Juin 2005 15:56, angelina zh a écrit :
 Jack,
  
 I dont understand why you keep saying there is nothing worng. The session got 
 established at the log in page and kept valid in the security re-diredct 
 pages till the welcome page. Then session got lost. Why there is nothing 
 wrong with it?
  
 The session id did not get lost, just the http session lost.
  
 Regards,
  
 Angelina
 
 Dakota Jack [EMAIL PROTECTED] wrote:
 There is nothing wrong. You don't have a new session in your browser.
 
 On 6/23/05, angelina zh wrote:
  Hi,
  
  Can anyone please help me on this session lost issue?
  
  Here is the problem I am getting:
  
  -- If I open a IE 6.0 browser and log into the web site we are developing, 
  I get into a welcome page with a few of link options. In the login action 
  class, we set some attributes into the session. If I click on any of the 
  links, I got null pointer exception in next action class when we try to get 
  attributes from the session. I tried to use Eclipse to debug, noticed that 
  the session of the request after the welcome page became to null.
  
  --If I keep that browser open and go to the log in page again. After I log 
  in, I get into the welcome page and if I click any of the links now, the 
  session of the request is not null and I can go to any links without any 
  problem. The null pointer did not occur in the following action class.
  
  --If I close the browser then open browser again, I get 
  NullPointerException again if I repeat those steps.
  
  What might be wrong?
  
  Thanks so much in advance.
  
  Angelina
  
  
  
  -
  Yahoo! Sports
  Rekindle the Rivalries. Sign up for Fantasy Football
  
 
 

-- 
David Delbecq
Royal Meteorological Institute of Belgium

-
Is there life after /sbin/halt -p?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: http session lost between struts action

2005-06-27 Thread angelina zh
David,
 
Thanks a lot for your help.
 
My browser accepts cookies. Actually I inspected the cookies as well as the 
session object when I was debugging. The cookies is a valid array with valid 
sessionId inside and the method isRequestedSessionIdFromCookie() returns true 
as long as the http session object is valid. But when the session got lost, the 
cookies became to null and the method isRequestedSessionIdFromCookie() returns 
false.
 
The links are the paths defined in the struct-config.xml file. The jsessionid 
is still valid when the session get lost.
 
Here is how the code looks like in the LogInAction:
MyObject myObj = new MyObject();
myObj.setAbc(Abc);
myObj,setDef(Def);
HttpSession session = request.getSession(true);
session.setAttribute(MySessionName, myObj);
 
Here is how the code looks like in the following actions:
MyObject myObj = (MyObject)request.getSession(true).getAttribute(MySessionName);
 
I have a FrontController servlet class to hand request and response. When a 
link on the welcome page got clicked, I noticed that in the FrontController 
servlet class, the session in the request became to null via eclipse's 
debugging tool. (Before this point, the session is all valid.) Then in the 
following action class, a new standard session got created. So my personal 
session information totally lost.
 
Anything else I shall try?
 
Thanks so much!
 
Angelina

David Smith [EMAIL PROTECTED] wrote:
Check these:

1. Your browser is accepting cookies
2. Your links are being generated by taglibs that insure the jsessionid 
is attached if needed. I say if needed because if tomcat is getting a 
valid session cookie from your browser, the jsessionid won't be added to 
the link.

They don't both have to be done, but chances of eliminating errors are 
best if they are. Beyond that, I would have to suspect the way you are 
trying to access the session attributes either in setting them or in 
retrieving them. Could you post code snippets that show how you are 
setting and retrieving attributes?

--David




-
Yahoo! Sports
 Rekindle the Rivalries. Sign up for Fantasy Football

RE: http session lost between struts action

2005-06-27 Thread Raghupathy,Gurumoorthy
Well the issue is 

request.getSession(true)

Try something like 

MyObject myObj = new MyObject();
myObj.setAbc(Abc);
myObj,setDef(Def);
HttpSession session = request.getSession(false);

If ( session == null ) {
session = request.getSession(true);
}

session.setAttribute(MySessionName, myObj);




HttpSession session = request.getSession(false);

If ( session != null ) {
MyObject myObj =
(MyObject)request.getSession(true).getAttribute(MySessionName);
}


Because HttpSession session = request.getSession(true); will always create a
new session 

Regards
Guru 
-Original Message-
From: angelina zh [mailto:[EMAIL PROTECTED] 
Sent: 27 June 2005 17:18
To: Tomcat Users List
Subject: Re: http session lost between struts action


David,
 
Thanks a lot for your help.
 
My browser accepts cookies. Actually I inspected the cookies as well as the
session object when I was debugging. The cookies is a valid array with valid
sessionId inside and the method isRequestedSessionIdFromCookie() returns
true as long as the http session object is valid. But when the session got
lost, the cookies became to null and the method
isRequestedSessionIdFromCookie() returns false.
 
The links are the paths defined in the struct-config.xml file. The
jsessionid is still valid when the session get lost.
 
Here is how the code looks like in the LogInAction:
MyObject myObj = new MyObject();
myObj.setAbc(Abc);
myObj,setDef(Def);
HttpSession session = request.getSession(true);
session.setAttribute(MySessionName, myObj);
 
Here is how the code looks like in the following actions:
MyObject myObj =
(MyObject)request.getSession(true).getAttribute(MySessionName);
 
I have a FrontController servlet class to hand request and response. When a
link on the welcome page got clicked, I noticed that in the FrontController
servlet class, the session in the request became to null via eclipse's
debugging tool. (Before this point, the session is all valid.) Then in the
following action class, a new standard session got created. So my personal
session information totally lost.
 
Anything else I shall try?
 
Thanks so much!
 
Angelina

David Smith [EMAIL PROTECTED] wrote:
Check these:

1. Your browser is accepting cookies
2. Your links are being generated by taglibs that insure the jsessionid 
is attached if needed. I say if needed because if tomcat is getting a 
valid session cookie from your browser, the jsessionid won't be added to 
the link.

They don't both have to be done, but chances of eliminating errors are 
best if they are. Beyond that, I would have to suspect the way you are 
trying to access the session attributes either in setting them or in 
retrieving them. Could you post code snippets that show how you are 
setting and retrieving attributes?

--David




-
Yahoo! Sports
 Rekindle the Rivalries. Sign up for Fantasy Football

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: http session lost between struts action

2005-06-27 Thread Frank W. Zammetti
I thought that at first too Guru, I had to go remind myself... looking at
the javadoc for request.getSession(boolean)...

Returns the current HttpSession associated with this request or, if there
is no current session and create is true, returns a new session.

That OR, IF clause is whats important.. it should only create a new
session if none already exists.  So, calling getSession(true) is going to
return to you a session either way, whether it's a pre-existing one or a
new one.

I do however agree that calling getSession(true) in this case does not
seem appropriate... Angelina, I would call it with false and check for
null, as Guru says.  It probably won't solve the problem, but it will tell
you a little bit more, namely whether the session really exists or not in
a more explicit manner.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Mon, June 27, 2005 12:23 pm, Raghupathy,Gurumoorthy said:
 Well the issue is

 request.getSession(true)

 Try something like

 MyObject myObj = new MyObject();
 myObj.setAbc(Abc);
 myObj,setDef(Def);
 HttpSession session = request.getSession(false);

 If ( session == null ) {
   session = request.getSession(true);
 }

 session.setAttribute(MySessionName, myObj);




 HttpSession session = request.getSession(false);

 If ( session != null ) {
   MyObject myObj =
 (MyObject)request.getSession(true).getAttribute(MySessionName);
 }


 Because HttpSession session = request.getSession(true); will always create
 a
 new session

 Regards
 Guru
 -Original Message-
 From: angelina zh [mailto:[EMAIL PROTECTED]
 Sent: 27 June 2005 17:18
 To: Tomcat Users List
 Subject: Re: http session lost between struts action


 David,

 Thanks a lot for your help.

 My browser accepts cookies. Actually I inspected the cookies as well as
 the
 session object when I was debugging. The cookies is a valid array with
 valid
 sessionId inside and the method isRequestedSessionIdFromCookie() returns
 true as long as the http session object is valid. But when the session got
 lost, the cookies became to null and the method
 isRequestedSessionIdFromCookie() returns false.

 The links are the paths defined in the struct-config.xml file. The
 jsessionid is still valid when the session get lost.

 Here is how the code looks like in the LogInAction:
 MyObject myObj = new MyObject();
 myObj.setAbc(Abc);
 myObj,setDef(Def);
 HttpSession session = request.getSession(true);
 session.setAttribute(MySessionName, myObj);

 Here is how the code looks like in the following actions:
 MyObject myObj =
 (MyObject)request.getSession(true).getAttribute(MySessionName);

 I have a FrontController servlet class to hand request and response. When
 a
 link on the welcome page got clicked, I noticed that in the
 FrontController
 servlet class, the session in the request became to null via eclipse's
 debugging tool. (Before this point, the session is all valid.) Then in the
 following action class, a new standard session got created. So my personal
 session information totally lost.

 Anything else I shall try?

 Thanks so much!

 Angelina

 David Smith [EMAIL PROTECTED] wrote:
 Check these:

 1. Your browser is accepting cookies
 2. Your links are being generated by taglibs that insure the jsessionid
 is attached if needed. I say if needed because if tomcat is getting a
 valid session cookie from your browser, the jsessionid won't be added to
 the link.

 They don't both have to be done, but chances of eliminating errors are
 best if they are. Beyond that, I would have to suspect the way you are
 trying to access the session attributes either in setting them or in
 retrieving them. Could you post code snippets that show how you are
 setting and retrieving attributes?

 --David




 -
 Yahoo! Sports
  Rekindle the Rivalries. Sign up for Fantasy Football

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: http session lost between struts action

2005-06-27 Thread angelina zh
Frank,  Guru
 
Thank you guys so much for the comments. But I forget to mention that the code 
was originally coded to request.getSession(false). Since it did not work for 
me, I changed to request.getSession(true).
 
So neither was working for me.
 
Angelina

Frank W. Zammetti [EMAIL PROTECTED] wrote:
I thought that at first too Guru, I had to go remind myself... looking at
the javadoc for request.getSession(boolean)...

Returns the current HttpSession associated with this request or, if there
is no current session and create is true, returns a new session.

That OR, IF clause is whats important.. it should only create a new
session if none already exists. So, calling getSession(true) is going to
return to you a session either way, whether it's a pre-existing one or a
new one.

I do however agree that calling getSession(true) in this case does not
seem appropriate... Angelina, I would call it with false and check for
null, as Guru says. It probably won't solve the problem, but it will tell
you a little bit more, namely whether the session really exists or not in
a more explicit manner.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Mon, June 27, 2005 12:23 pm, Raghupathy,Gurumoorthy said:
 Well the issue is

 request.getSession(true)

 Try something like

 MyObject myObj = new MyObject();
 myObj.setAbc(Abc);
 myObj,setDef(Def);
 HttpSession session = request.getSession(false);

 If ( session == null ) {
 session = request.getSession(true);
 }

 session.setAttribute(MySessionName, myObj);




 HttpSession session = request.getSession(false);

 If ( session != null ) {
 MyObject myObj =
 (MyObject)request.getSession(true).getAttribute(MySessionName);
 }


 Because HttpSession session = request.getSession(true); will always create
 a
 new session

 Regards
 Guru
 -Original Message-
 From: angelina zh [mailto:[EMAIL PROTECTED]
 Sent: 27 June 2005 17:18
 To: Tomcat Users List
 Subject: Re: http session lost between struts action


 David,

 Thanks a lot for your help.

 My browser accepts cookies. Actually I inspected the cookies as well as
 the
 session object when I was debugging. The cookies is a valid array with
 valid
 sessionId inside and the method isRequestedSessionIdFromCookie() returns
 true as long as the http session object is valid. But when the session got
 lost, the cookies became to null and the method
 isRequestedSessionIdFromCookie() returns false.

 The links are the paths defined in the struct-config.xml file. The
 jsessionid is still valid when the session get lost.

 Here is how the code looks like in the LogInAction:
 MyObject myObj = new MyObject();
 myObj.setAbc(Abc);
 myObj,setDef(Def);
 HttpSession session = request.getSession(true);
 session.setAttribute(MySessionName, myObj);

 Here is how the code looks like in the following actions:
 MyObject myObj =
 (MyObject)request.getSession(true).getAttribute(MySessionName);

 I have a FrontController servlet class to hand request and response. When
 a
 link on the welcome page got clicked, I noticed that in the
 FrontController
 servlet class, the session in the request became to null via eclipse's
 debugging tool. (Before this point, the session is all valid.) Then in the
 following action class, a new standard session got created. So my personal
 session information totally lost.

 Anything else I shall try?

 Thanks so much!

 Angelina

 David Smith wrote:
 Check these:

 1. Your browser is accepting cookies
 2. Your links are being generated by taglibs that insure the jsessionid
 is attached if needed. I say if needed because if tomcat is getting a
 valid session cookie from your browser, the jsessionid won't be added to
 the link.

 They don't both have to be done, but chances of eliminating errors are
 best if they are. Beyond that, I would have to suspect the way you are
 trying to access the session attributes either in setting them or in
 retrieving them. Could you post code snippets that show how you are
 setting and retrieving attributes?

 --David




 -
 Yahoo! Sports
 Rekindle the Rivalries. Sign up for Fantasy Football

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: http session lost between struts action

2005-06-27 Thread David Smith
You might want to setup the Request Dumper Valve 
(*org.apache.catalina.valves.RequestDumperValve*.) and see if that 
offer's any insight.  I suspect the cookie isn't being returned in 
subsequent requests after the welcome page.  Unfortunately, I don't have 
enough info about your setup to even begin theorizing why that might happen.


--David


angelina zh wrote:


Frank,  Guru

Thank you guys so much for the comments. But I forget to mention that the code 
was originally coded to request.getSession(false). Since it did not work for 
me, I changed to request.getSession(true).

So neither was working for me.

Angelina

Frank W. Zammetti [EMAIL PROTECTED] wrote:
I thought that at first too Guru, I had to go remind myself... looking at
the javadoc for request.getSession(boolean)...

Returns the current HttpSession associated with this request or, if there
is no current session and create is true, returns a new session.

That OR, IF clause is whats important.. it should only create a new
session if none already exists. So, calling getSession(true) is going to
return to you a session either way, whether it's a pre-existing one or a
new one.

I do however agree that calling getSession(true) in this case does not
seem appropriate... Angelina, I would call it with false and check for
null, as Guru says. It probably won't solve the problem, but it will tell
you a little bit more, namely whether the session really exists or not in
a more explicit manner.

 




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: http session lost between struts action

2005-06-27 Thread Medha Parathasarathy
Hi

Can you assist me in setting up an infrastruture on the following
ground:

linux, mysql, tomcat, jdbc.  I am not in a position to sym the last
three to get my site up

Regards


Medha Parthasarathy
On MoHin, 27 Jun 2005 17:23:15 +0100, Raghupathy,Gurumoorthy
[EMAIL PROTECTED] said:
 Well the issue is 
 
 request.getSession(true)
 
 Try something like 
 
 MyObject myObj = new MyObject();
 myObj.setAbc(Abc);
 myObj,setDef(Def);
 HttpSession session = request.getSession(false);
 
 If ( session == null ) {
   session = request.getSession(true);
 }
 
 session.setAttribute(MySessionName, myObj);
 
 
 
 
 HttpSession session = request.getSession(false);
 
 If ( session != null ) {
   MyObject myObj =
 (MyObject)request.getSession(true).getAttribute(MySessionName);
 }
 
 
 Because HttpSession session = request.getSession(true); will always
 create a
 new session 
 
 Regards
 Guru 
 -Original Message-
 From: angelina zh [mailto:[EMAIL PROTECTED] 
 Sent: 27 June 2005 17:18
 To: Tomcat Users List
 Subject: Re: http session lost between struts action
 
 
 David,
  
 Thanks a lot for your help.
  
 My browser accepts cookies. Actually I inspected the cookies as well as
 the
 session object when I was debugging. The cookies is a valid array with
 valid
 sessionId inside and the method isRequestedSessionIdFromCookie() returns
 true as long as the http session object is valid. But when the session
 got
 lost, the cookies became to null and the method
 isRequestedSessionIdFromCookie() returns false.
  
 The links are the paths defined in the struct-config.xml file. The
 jsessionid is still valid when the session get lost.
  
 Here is how the code looks like in the LogInAction:
 MyObject myObj = new MyObject();
 myObj.setAbc(Abc);
 myObj,setDef(Def);
 HttpSession session = request.getSession(true);
 session.setAttribute(MySessionName, myObj);
  
 Here is how the code looks like in the following actions:
 MyObject myObj =
 (MyObject)request.getSession(true).getAttribute(MySessionName);
  
 I have a FrontController servlet class to hand request and response. When
 a
 link on the welcome page got clicked, I noticed that in the
 FrontController
 servlet class, the session in the request became to null via eclipse's
 debugging tool. (Before this point, the session is all valid.) Then in
 the
 following action class, a new standard session got created. So my
 personal
 session information totally lost.
  
 Anything else I shall try?
  
 Thanks so much!
  
 Angelina
 
 David Smith [EMAIL PROTECTED] wrote:
 Check these:
 
 1. Your browser is accepting cookies
 2. Your links are being generated by taglibs that insure the jsessionid 
 is attached if needed. I say if needed because if tomcat is getting a 
 valid session cookie from your browser, the jsessionid won't be added to 
 the link.
 
 They don't both have to be done, but chances of eliminating errors are 
 best if they are. Beyond that, I would have to suspect the way you are 
 trying to access the session attributes either in setting them or in 
 retrieving them. Could you post code snippets that show how you are 
 setting and retrieving attributes?
 
 --David
 
 
 
   
 -
 Yahoo! Sports
  Rekindle the Rivalries. Sign up for Fantasy Football
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

-- 
http://www.fastmail.fm - Accessible with your email software
  or over the web


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: http session lost between struts action

2005-06-26 Thread Torsten Römer
But they use Struts, where URL rewriting is done automatically if 
cookies are disabled, presumed the relevant tags are used rather than 
plain HTML links, for example.


Maybe that's the problem, that in some link, form action or redirect the 
jsessionid is missing. Then of course the session is lost.


Torsten

Charl Gerber schrieb:

If your session data is stored as a session cookie (I
*think* this is default behaviour), then your session
will get lost if you have cookies disabled on your
browser. 




--- angelina zh [EMAIL PROTECTED] wrote:


Michael,

Thank you so much for your reply. The login page is
a JSP page. In the JSP page, the login form's mothod
is post and the action is a struts action.

After login, we did some internal redircts for
security checking and then take the user to the
welcome page. The welcome page is generated from XML
using xslt. 


We have a FrontController which extends
ActionServlet from struts to handle request and
response. I kept very close watching of the
requests. I am very sure that the session has been
established on the login page and kept valid till
the welcome's action got invoked and the welcome
page got constructed. After I clicked one of the
links on the welcome page, I noticed that when the
FrontController got invoked, the session had became
to null. So we lost session before the next action
class get invoked.

We can easier re-create the session object, but we
lost the attributes we set in the last session. The
following action classes will need those attriutes. 


I am wondering why the session keep valid if I login
to the page again without closing browser. But the
session get lost if I open another browser to log
in. 


And another interesting thing is the session get
lost in another place in the production enviroment.

I am not sure this is a tomcat issue or a struts
issue.

Michael, any help will be greatly appreciated.




-
Yahoo! Sports
Rekindle the Rivalries. Sign up for Fantasy

Football


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: http session lost between struts action

2005-06-26 Thread Dakota Jack
There is nothing wrong.  You don't have a new session in your browser.

On 6/23/05, angelina zh [EMAIL PROTECTED] wrote:
 Hi,
 
 Can anyone please help me on this session lost issue?
 
 Here is the problem I am getting:
 
 -- If I open a IE 6.0 browser and log into the web site we are developing, I 
 get into a welcome page with a few of link options. In the login action 
 class, we set some attributes into the session. If I click on any of the 
 links, I got null pointer exception in next action class when we try to get 
 attributes from the session. I tried to use Eclipse to debug, noticed that 
 the session of the request after the welcome page became to null.
 
 --If I keep that browser open and go to the log in page again. After I log 
 in, I get into the welcome page and if I click any of the links now, the 
 session of the request is not null and I can go to any links without any 
 problem. The null pointer did not occur in the following action class.
 
 --If I close the browser then open browser again, I get NullPointerException 
 again if I repeat those steps.
 
 What might be wrong?
 
 Thanks so much in advance.
 
 Angelina
 
 
 
 -
 Yahoo! Sports
  Rekindle the Rivalries. Sign up for Fantasy Football
 


-- 
You can lead a horse to water but you cannot make it float on its back.
~Dakota Jack~

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: http session lost between struts action

2005-06-26 Thread Dakota Jack
Again there is nothing wrong, so the fix does not help.  ///;-)


On 6/23/05, angelina zh [EMAIL PROTECTED] wrote:
 Michael,
 
 Thank you so much for your reply. The login page is a JSP page. In the JSP 
 page, the login form's mothod is post and the action is a struts action.
 
 After login, we did some internal redircts for security checking and then 
 take the user to the welcome page. The welcome page is generated from XML 
 using xslt.
 
 We have a FrontController which extends ActionServlet from struts to handle 
 request and response. I kept very close watching of the requests. I am very 
 sure that the session has been established on the login page and kept valid 
 till the welcome's action got invoked and the welcome page got constructed. 
 After I clicked one of the links on the welcome page, I noticed that when the 
 FrontController got invoked, the session had became to null. So we lost 
 session before the next action class get invoked.
 
 We can easier re-create the session object, but we lost the attributes we set 
 in the last session. The following action classes will need those attriutes.
 
 I am wondering why the session keep valid if I login to the page again 
 without closing browser. But the session get lost if I open another browser 
 to log in.
 
 And another interesting thing is the session get lost in another place in the 
 production enviroment.
 
 I am not sure this is a tomcat issue or a struts issue.
 
 Michael, any help will be greatly appreciated.
 
 
 
 
 -
 Yahoo! Sports
  Rekindle the Rivalries. Sign up for Fantasy Football
 


-- 
You can lead a horse to water but you cannot make it float on its back.
~Dakota Jack~

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: http session lost between struts action

2005-06-26 Thread Dakota Jack
Again, there is no problem, so don't accept any solutions.  You leave
some (most actually) open and the session remains open.



On 6/26/05, Torsten Römer [EMAIL PROTECTED] wrote:
 But they use Struts, where URL rewriting is done automatically if
 cookies are disabled, presumed the relevant tags are used rather than
 plain HTML links, for example.
 
 Maybe that's the problem, that in some link, form action or redirect the
 jsessionid is missing. Then of course the session is lost.
 
 Torsten
 
 Charl Gerber schrieb:
  If your session data is stored as a session cookie (I
  *think* this is default behaviour), then your session
  will get lost if you have cookies disabled on your
  browser.
 
 
 
  --- angelina zh [EMAIL PROTECTED] wrote:
 
 Michael,
 
 Thank you so much for your reply. The login page is
 a JSP page. In the JSP page, the login form's mothod
 is post and the action is a struts action.
 
 After login, we did some internal redircts for
 security checking and then take the user to the
 welcome page. The welcome page is generated from XML
 using xslt.
 
 We have a FrontController which extends
 ActionServlet from struts to handle request and
 response. I kept very close watching of the
 requests. I am very sure that the session has been
 established on the login page and kept valid till
 the welcome's action got invoked and the welcome
 page got constructed. After I clicked one of the
 links on the welcome page, I noticed that when the
 FrontController got invoked, the session had became
 to null. So we lost session before the next action
 class get invoked.
 
 We can easier re-create the session object, but we
 lost the attributes we set in the last session. The
 following action classes will need those attriutes.
 
 I am wondering why the session keep valid if I login
 to the page again without closing browser. But the
 session get lost if I open another browser to log
 in.
 
 And another interesting thing is the session get
 lost in another place in the production enviroment.
 
 I am not sure this is a tomcat issue or a struts
 issue.
 
 Michael, any help will be greatly appreciated.
 
 
 
 
 -
 Yahoo! Sports
  Rekindle the Rivalries. Sign up for Fantasy
  Football
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-- 
You can lead a horse to water but you cannot make it float on its back.
~Dakota Jack~

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: http session lost between struts action

2005-06-24 Thread Charl Gerber
If your session data is stored as a session cookie (I
*think* this is default behaviour), then your session
will get lost if you have cookies disabled on your
browser. 



--- angelina zh [EMAIL PROTECTED] wrote:

 Michael,
  
 Thank you so much for your reply. The login page is
 a JSP page. In the JSP page, the login form's mothod
 is post and the action is a struts action.
  
 After login, we did some internal redircts for
 security checking and then take the user to the
 welcome page. The welcome page is generated from XML
 using xslt. 
  
 We have a FrontController which extends
 ActionServlet from struts to handle request and
 response. I kept very close watching of the
 requests. I am very sure that the session has been
 established on the login page and kept valid till
 the welcome's action got invoked and the welcome
 page got constructed. After I clicked one of the
 links on the welcome page, I noticed that when the
 FrontController got invoked, the session had became
 to null. So we lost session before the next action
 class get invoked.
  
 We can easier re-create the session object, but we
 lost the attributes we set in the last session. The
 following action classes will need those attriutes. 
  
 I am wondering why the session keep valid if I login
 to the page again without closing browser. But the
 session get lost if I open another browser to log
 in. 
  
 And another interesting thing is the session get
 lost in another place in the production enviroment.
  
 I am not sure this is a tomcat issue or a struts
 issue.
  
 Michael, any help will be greatly appreciated.
  
  
 
   
 -
 Yahoo! Sports
  Rekindle the Rivalries. Sign up for Fantasy
Football


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



http session lost between struts action

2005-06-23 Thread angelina zh
Hi,
 
Can anyone please help me on this session lost issue?
 
Here is the problem I am getting:
 
-- If I open a IE 6.0 browser and log into the web site we are developing, I 
get into a welcome page with a few of link options. In the login action class, 
we set some attributes into the session. If I click on any of the links, I got 
null pointer exception in next action class when we try to get attributes from 
the session. I tried to use Eclipse to debug, noticed that the session of the 
request after the welcome page became to null.
 
--If I keep that browser open and go to the log in page again. After I log in, 
I get into the welcome page and if I click any of the links now, the session of 
the request is not null and I can go to any links without any problem. The null 
pointer did not occur in the following action class.
 
--If I close the browser then open browser again, I get NullPointerException 
again if I repeat those steps.
 
What might be wrong?
 
Thanks so much in advance.
 
Angelina



-
Yahoo! Sports
 Rekindle the Rivalries. Sign up for Fantasy Football

Re: http session lost between struts action

2005-06-23 Thread Michael Jouravlev
On 6/23/05, angelina zh [EMAIL PROTECTED] wrote:
 -- If I open a IE 6.0 browser and log into the web site we are developing

How do you log in? Do you navigate to static HTML page, to JSP page,
to Struts login action? Who generates this page or where this page is
being forwarded from?

 In the login action class, we set some attributes into the session.
 If I click on any of the links, I got null pointer exception in next
 action class when we try to get attributes from the session. ...
 If I keep that browser open and go to the log in page again. After
 I log in, I get into the welcome page and if I click any of the
 links now, the session of the request is not null and I can go to
 any links without any problem. The null pointer did not occur in
 the following action class.

Seems that session was not established when you accessed the link from
the welcome page. Are you sure that this page is generated by action
class, or from a JSP page with cleared session attribute of page
directive?

You can use static HTML welcome page, if:
* you forward to it from action class or JSP, and
* you created session object in the action class or JSP, or
* you do not clear session attribute of page directive

Session is created in action class, if you access session object and
set it to auto-create, if session is not there yet. Session is created
in JSP, if you do not explicitly clear session attribute of page
directive; by default session attribute is set.

Michael.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: http session lost between struts action

2005-06-23 Thread angelina zh
Michael,
 
Thank you so much for your reply. The login page is a JSP page. In the JSP 
page, the login form's mothod is post and the action is a struts action.
 
After login, we did some internal redircts for security checking and then take 
the user to the welcome page. The welcome page is generated from XML using 
xslt. 
 
We have a FrontController which extends ActionServlet from struts to handle 
request and response. I kept very close watching of the requests. I am very 
sure that the session has been established on the login page and kept valid 
till the welcome's action got invoked and the welcome page got constructed. 
After I clicked one of the links on the welcome page, I noticed that when the 
FrontController got invoked, the session had became to null. So we lost session 
before the next action class get invoked.
 
We can easier re-create the session object, but we lost the attributes we set 
in the last session. The following action classes will need those attriutes. 
 
I am wondering why the session keep valid if I login to the page again without 
closing browser. But the session get lost if I open another browser to log in. 
 
And another interesting thing is the session get lost in another place in the 
production enviroment.
 
I am not sure this is a tomcat issue or a struts issue.
 
Michael, any help will be greatly appreciated.
 
 


-
Yahoo! Sports
 Rekindle the Rivalries. Sign up for Fantasy Football