As Michael alluded to in his response, a session will be created when
the user hits index.jsp unless you explicitly specify session=false in
the page directive. (See
http://java.sun.com/products/jsp/syntax/2.0/syntaxref2010.html#15653)
That's probably what's going on here.
- Scott
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 29, 2005 12:04 PM
To: user@struts.apache.org
Subject: Struts and Sessions Problem
Hello all!
I have a problem with struts and sessions, perhaps someone
has an idea:
My web.xml contains the following welcome file list:
welcome-file-list
welcome-fileindex.jsp/welcome-file
/welcome-file-list
My index.jsp only forwards like this:
%@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic % html
body
logic:forward name=cookiecheck/
/body
/html
My struts-config uses a global forward to map it like this:
global-forwards
forward name=cookiecheck path=/checkcookies.do
redirect=false/
/global-forwards
In the struts-config the final mapping to the action is this one:
action
path=/checkcookies
unknown=true
type=somepackage.CheckCookiesAction
scope=request
validate=false
forward name=Failure path=/login.jsp redirect=false/
forward name=Success path=/home.jsp redirect=false/
/action
In CheckCookiesAction which extends Action, in the
execute(...) method I get the HTTPSession like this:
HttpSession session = request.getSession( false ) );
My problem: when a user accesses my webapp for the first time
this method does not return null, although it should do so!
It is no problem of Tomcat 5.5.9 I am using, the Servlet I
wrote for testing does its work properly and returns null if
the user accesses my page for the first time. So why does
Struts behave like this? Is it because of all the forwarding
and redirecting, although it should have no effect in my opinion?
Perhaps someone knows whats going wrong
Peter
--
MATERNA GmbH Information Communications Vosskuhle 37
44141 Dortmund
Tel: +49-231-5599-8868
Fax: +49-231-5599-678868
[EMAIL PROTECTED]
www.annyway.dewww.materna.de
www.annyway.com www.materna.com
Visit us at the following events:
ACI EUROPE, Munich
June, 22 - 24, 2005
ACI EUROPE, Verona
September, 26 - 28, 2005
CTIA Wireless I.T. Entertainment 2005, San Francisco
September, 27 - 29, 2005
Con4, Cologne
September, 27 - 29, 2005
-
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]