Hi,
servlets called through SSI are able only to retrieve existing sessions
if these were previously created by a non-SSI servlet (a "pure" one).
The reason is simple:
- SSI doesnt allow too much URL-rewriting (URLs are hard-coded in HTML)
- So it needs cookies for session management.
-The top of the html that preceeded the <SERVLET > tag has already
been sent back to the browser, *before* servlet's doPost() or doGet()
is called, but
- To create a new session it needs to write a cookie, in a HTTP header
- but all headers need to be sent before any html, before <servlet > tag
was reached - this is your problem.
Dont know if same restrictions apply for JSP.
Probably a smarter web server/servlet engine should cache the output
untill all <servlet > tags are processed, allowing servlets to add/change
headers (and create new sessions) but obviously that isnt yours.
Regards,
Cezar
On Tue, 24 Aug 1999, Paul Szynol wrote:
> hi, everyone,
>
> i am using a <servlet> tag in an html page. the servlet itself passes
> values to the user's session object.
>
> i've found that every request for the .html page produces a new session
> object, as opposed to working with the session object that i assumed would
> already exist.
>
> am i doing something wrong, or is there no persistent session object with
> server-side includes?
>
> thanks very much.
>
> best,
> paul
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html