You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Collins, Jim" <ji...@uk.nomura.com> on 2003/06/24 11:36:13 UTC

OT Passing parameters to a link with an anchor

Hi,

Appologies for the off topic posting. 

I have the following link in a page that works fine:

<a name="notcurrent"
href="/itinerary/updatenode.do?id=1111&expanded=true">Trip</a>

What I would like to do though is add an anchor so that I go to a particular
point in the page so I tried including an anchor like this:

<a name="notcurrent"
href="/itinerary/updatenode.do#current?id=1111&expanded=true">Trip</a>

The problem is that now I can't access any of the attributes,
request.getParameter("id") now returns null.

Does anyone know if this is possible.

Thanks

Jim.


PLEASE READ: The information contained in this email is confidential
and intended for the named recipient(s) only. If you are not an intended
recipient of this email you must not copy, distribute or take any 
further action in reliance on it and you should delete it and notify the
sender immediately. Email is not a secure method of communication and 
Nomura International plc cannot accept responsibility for the accuracy
or completeness of this message or any attachment(s). Please examine this
email for virus infection, for which Nomura International plc accepts
no responsibility. If verification of this email is sought then please
request a hard copy. Unless otherwise stated any views or opinions
presented are solely those of the author and do not represent those of
Nomura International plc. This email is intended for informational
purposes only and is not a solicitation or offer to buy or sell
securities or related financial instruments. Nomura International plc is
regulated by the Financial Services Authority and is a member of the
London Stock Exchange.



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


Re: OT Passing parameters to a link with an anchor

Posted by Nikola Milutinovic <Ni...@ev.co.yu>.
> I have the following link in a page that works fine:
> 
> <a name="notcurrent"
> href="/itinerary/updatenode.do?id=1111&expanded=true">Trip</a>
> 
> What I would like to do though is add an anchor so that I go to a particular
> point in the page so I tried including an anchor like this:
> 
> <a name="notcurrent"
> href="/itinerary/updatenode.do#current?id=1111&expanded=true">Trip</a>

This looks ugly, but I understand what you're trying to achieve. Have you tried reversing the order?

<a href="/itinerary/updatenode.do?id=1111&expanded=true#current">Trip</a>

If I understand correctly, "#..." part is interpreted (or ignored) by the browser. So, the browser should cut off everything after the "#"sign, send request for the first part and jump to an anchor defined by the second part. So, in your case, the browser is cutting off the "current?id=1111&expanded=true" and expecting an anchor in the resulting page.

Nix.