Umm, yeah. You just said it. If you do getSession(false), it won't create
a new session. What's failing you? I'm no session expert, but I'm using
them in this project a bit and I'm really impressed by how nice they are to
use, especially like setAttribute(String name, Object o). I thought I was
gonna have to like set some sort of Hash code in a cookie and then hash into
some static hashtable to get user-specific java objects, but I don't. Nice.
jeb.
> -----Original Message-----
> From: Lucas Ludvig [mailto:jojwig2@hotmail.com]
> Sent: Thursday, August 10, 2000 2:16 PM
> To: tomcat-user@jakarta.apache.org
> Subject: Session Question: creation of a session
>
>
>
> Hello Tomcat/Servlet Gurus:
>
> Sessions are failing me and I am on a mission to learn
> everything there is
> to know about sessions. My first question is:
>
> According to the servlet javadocs..
>
> HttpServletRequest.getSession()
> - Returns the current session associated with this request, or if the
> request does not have a session, creates one.
>
> vs.
>
> HttpServletRequest.getSession(boolean)
> - Returns the current HttpSession associated with this
> request, or if if
> there is no current session and create is true, returns a new session.
>
> Is there any difference?
> Thanks,
>
> Luke
>
>
> ______________________________________________________________
> __________
> Get Your Private, Free E-mail from MSN Hotmail at
> http://www.hotmail.com
>
|