You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bryce Nesbitt <br...@obviously.com> on 2006/05/05 05:40:06 UTC

Two mysteries: ;jsessionid and bad img tag

I've just been gifted with a struts application to maintain.
 Things are pretty good, but here are two little mysteries I
need a little help on.  The struts jsp looks like:

<td><html:link page="/"><html:img page="/images/logo.gif"
alt="XX"
width="326" height="111" hspace="0" vspace="0" border="0"
/></html:link></td>

And the resulting HTML is like this:

<td><a href="/;jsessionid=XXXXXXXXXXX"><img
src="/images/logo.gif"
height="111" width="326" border="0" hspace="0" vspace="0"
alt="XX"></a></td>

Why the ";" in the jessionid, instead of &?

And why is there no "/" at the end of the img tag, which is
inconsistent with the rest of the XHTML markup.

These two small issues annoy the Tidy HTML validator in
Firefox, http://users.skynet.be/mgueury/mozilla/

----
Visit http://www.obviously.com/




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Two mysteries: ;jsessionid and bad img tag

Posted by Craig McClanahan <cr...@apache.org>.
On 5/4/06, Bryce Nesbitt <br...@obviously.com> wrote:
>
> I've just been gifted with a struts application to maintain.
> Things are pretty good, but here are two little mysteries I
> need a little help on.  The struts jsp looks like:
>
> <td><html:link page="/"><html:img page="/images/logo.gif"
> alt="XX"
> width="326" height="111" hspace="0" vspace="0" border="0"
> /></html:link></td>
>
> And the resulting HTML is like this:
>
> <td><a href="/;jsessionid=XXXXXXXXXXX"><img
> src="/images/logo.gif"
> height="111" width="326" border="0" hspace="0" vspace="0"
> alt="XX"></a></td>
>
> Why the ";" in the jessionid, instead of &?


The servlet spec requires that the session identifier be a "path parameter"
rather than a "query parameter".  In the syntax of a URL, you can actually
add path parameters after any element of the path (
http://localhost:8080/foo;bar=baz/bop), but the session id goes on the last
one.

And why is there no "/" at the end of the img tag, which is
> inconsistent with the rest of the XHTML markup.


Which version of Struts are you using?  I vaguely recall problems like this
in the very early ones, but not more recently.

These two small issues annoy the Tidy HTML validator in
> Firefox, http://users.skynet.be/mgueury/mozilla/


It may be that the validator needs to be made to understand what a path
parameter is.

----
> Visit http://www.obviously.com/


Craig

Re: Two mysteries: ;jsessionid and bad img tag

Posted by Michael Jouravlev <jm...@gmail.com>.
On 5/4/06, Bryce Nesbitt <br...@obviously.com> wrote:
> I've just been gifted with a struts application to maintain.
>  Things are pretty good, but here are two little mysteries I
> need a little help on.  The struts jsp looks like:
>
> <td><html:link page="/"><html:img page="/images/logo.gif"
> alt="XX"
> width="326" height="111" hspace="0" vspace="0" border="0"
> /></html:link></td>
>
> And the resulting HTML is like this:
>
> <td><a href="/;jsessionid=XXXXXXXXXXX"><img
> src="/images/logo.gif"
> height="111" width="326" border="0" hspace="0" vspace="0"
> alt="XX"></a></td>
>
> Why the ";" in the jessionid, instead of &?

Because this is session ID, not a query parameter. You cannot read it
from Request object as a query parameter or as a mere substring of a
whole URL (this, it is not considered as a part of URL).

> And why is there no "/" at the end of the img tag, which is
> inconsistent with the rest of the XHTML markup.

Try wrapping your JSP page into <html:html xhtml="true>  tag.

Michael.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org