thanks for the response.

I couldn't find it in the archives either.  I'm pretty new to the server
side java (been client side for the last 5 years), servlets and all that so
I may have some basic misunderstandings.  It looks to me like any anchors in
the HTML result will need to have encodeURL or encodeRedirectURL applied to
them.  Looking at the struts code the ActionServlet, it looks like struts
appends the session only if the redirect flag is on.  I may also not
understand the definition of URL rewriting here, but can not find a
definition.  

If I'm always forwarding through struts using say success and failure how
would I know to do anything?  As I see it the beauty of the forwarding
mechanism is that I don't have to know the destination in the action
subclass.  Yet if I'm understanding this, I'll lose the session id.  I seem
to keep it if I always set the redirect flag in the forward class, but I'm
suspicious that that is not the correct way.

To further complicate this, we're using a menu program to generate the
javascript for a horizontal menu at the top.  Looks like (and what I'm in
the middle of doing now) I'll need to manually append ";jsessionid=nnnn" in
a javascript function and then do a "location=".  As we're both invoking jsp
and "*.do" actions, I'm parsing to figure out whether to append the session
or not.

If I'm going through a lot of work for something that should be done another
way, I'd love to know.  



> -----Original Message-----
> From: Keith [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 20, 2002 6:14 AM
> To: Struts Users Mailing List
> Subject: Re: sessions
> 
> 
> Hi Bill,
> This has been answered but I couldn't find the answer in the archive!
> I'm not the expert here but - it's when a new session is created.
> Struts doesn't know if the browser accepts cookies (where the 
> session id is to
> be stored) so puts it in the URL (URL re-writing). On the 
> next request struts
> knows the cookie is accepted so doesn't need to put the 
> sessionId inthe URL.
> So every time you see that it's the symptom of a new session 
> being created - no
> the cause.
> 

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

Reply via email to