Matthias Kerkhoff wrote:
> Hi'ya - I've just discovered a widespread problem in most
> struts tags. Nearly all tags will fail to handle anchors
> (that's a kind of intra-document reference) properly.
> Anchors have to be the last part of an URI/URL - even
> if a query string is present. Because struts, as most
> other taglibs appends the query parameter always at the
> end of a given URL
>
> A fictive example:
> Appending variable a and b with the values 1 and 2 as
> query string to www.myserver.com/myapp.jsp#footer (one
> could use the link tag for this) will result in
> www.myserver.com/myapp.jsp#footer?a=1&c=2, but the correct
> result should be www.myserver.com/myapp.jsp?a=1&c=2#footer.
> I could also throw in the path-info, but this is less
> often used and would complicate things even more.
>
Yep, that's a bug when you use the link tag's ability to create query parameters
dynamically. Yuck.
>
> Using WLS 5.1, there is an additional side-effect of the
> way struts (doesn't) handle anchors: The session will
> be lost, if url-rewriting is used and the URL in question
> contains an anchor (BTW: Weblogic has the same "bug", it
> also appends the URL always at the end, ignoring anchors
> completly)
>
The servlet 2.2 spec requires that the session id be passed as a *path*
parameter (separated from the base URI by a semicolon), not a *query*
parameter. Was it WebLogic or one of the other servers that was also not doing
this right.
At any rate, Struts will rely on the servlet container's response.encodeURL()
method to do the URL rewriting, so there's nothing Struts can do about a
container that gets this wrong.
>
> --
> Matthias mailto:[EMAIL PROTECTED]
Craig