On Tue, 1 Jun 1999, Henner Zeller wrote:

> I'd propose generating the session with one single
> Servlet (no SSI) and _use_ it within servlets embedded in SSI pages (they
> can _read_ the Headers). 

I thought about this, but this would mean requiring users to go
through a "special" URL to establish a session. But implementing this
approach would be pretty simple.

> But you're right: if using Sessions and SSI one shouldn't be stuck with
> URL rewriting .. so

Not only that -- URL rewriting seems pretty incompatible with SSI. Any
link in a .jhtml document would need to be munged, or the session
would be lost. Yucky.

> I just implemented it in the pre 1.1 Java Apache SSI. I am buffering the
> whole stuff with a ByteArrayOutputStream and flush it at the end (no way
> around that). committing it today to CVS.
> 
> This now makes cookies generated from servlets inside the page work.

Very cool. A nitpicking question: will a session newly created by a
servlet exist to subsequently-invoked servlets during the same HTTP
request? Ex: If servlet x does a req.getSession(true) and, will
servlet y get the session just created by x when y calls
req.getSession(...)? I would hope that we all agree that this should
happen.

> Just thinking about making buffering the default behaviour for SSI. It has
> some advantages but OTOH, the user has to wait until the _whole_ page is
> generated ..

If session tracking is always enabled, then this wouldn't be a
problem, right? If there were a session tracking subclass of the SSI
servlet, or if the behavior were specified as an init parameter, the
non-buffering implementation could be used for both cases. If this
were to happen, I would suggest throwing an exception if
getSession(true) is invoked on a servlet request object and session
tracking is disabled, because creating a session isn't going to work
in this case. This would prevent the sort of silent failure that is
the source of many a FAQ.

Can you tell that I really don't like the idea of buffering output? ;)

Ed










------------------------------------------------------------
To subscribe:    [EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Problems?:       [EMAIL PROTECTED]

Reply via email to