hi andy

the following mailings from end of june, will give you at least an answer to the 
question, why the session-id is used in the tag.

marcel




From:   [EMAIL PROTECTED]
Sent:   Freitag, 22. Juni 2001 12:18
To:     [EMAIL PROTECTED]
Subject:        Re: URL encoding in <html:image> and <html:img> tags

DUBOIS Fabrice typed the following on 11:34 AM 6/22/2001 +0200
>I don't understand why Struts's <html:image> and <html:img> tags encodes GIF's names 
>with session's ID ? 
>
>I am using : 
>    * <html:image> tag with <html:form>  
>    * <html:img> tag with <html:link>  
>    * <html:img> standalone 
>in my JSP's pages. 
>
>For me, it seems to be useless to encode SRC attribute for those two tags since 
><html:form> and <html:link> encodes ACTION and PAGE attribute with session's ID.
>
>In the third case (<html:img> standalone), I really don't understand why session's ID 
>is added to image path ??? 

The session ID is encoded into a URL so that, when the URL is loaded
by the client, the servlet engine knows which session the client belongs
to. 

The action encoding of the form is used when the form is submitted.
The URL encoding of the image is used when the image is loaded.
These happen at different times, on different requests, so having the form 
action URL encoded doesn't help the image URL. The same presumably
goes for the link - the image is loaded as a different request from the
one where the user clicks the link, so each needs to have the session
ID encoded separately.

So then the question may be, why does an image URL need to have
the session ID encoded into it - since images are static content, the
server shouldn't care what session it belongs to. The answer is that
not all images are static, some images are generated by servlets,
so struts needs to support encoding the URL.

-----------------------------------------------------------------------------

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 11, 2001 3:59 PM
To: [EMAIL PROTECTED]
Subject: Apache, IIS , <html:img> tag


The code <html:img src="struts-power.gif" alt="Powered by Struts"/> gives me
the HTML below.
<img src="struts-power.gif;jsessionid=k54f1xn3y1" alt="Powered by Struts">

This results in the image not being displayed when I use tomcat with apache
web server 
It is displayed fine when I use tomcat with iis though!

For what reason does it append the sessionid to it?? 
Do you know why it works with iis and not apache?

cheers

Andy


---------------------------------------------------------------------
To send us encrypted mail, please refer to:
http://www.millionhandshakes.com/emailpolicy/pgp.html

Million Handshakes

Reply via email to