Hi Marius,

I wondered this too - so I had a look. I think the problem here is more of a
HTTP one - if you use netcat - one of my most favouritest tools, available
from:

        http://www.atstake.com/research/tools/network_utilities/

... and run netcat with the following command:

        X:\>nc -l -p 8000

.. this will then have nc listen on port 8000. Putting the following URL in
Mozilla or IE:

        http://localhost:8000/page.do#booboo

... then this will be the result displayed in nc:

        GET /page.do HTTP/1.1
        Host: localhost:8000
        User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5a)
Gecko/20030718
        Accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=
0.8,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1
        Accept-Language: en-us,en;q=0.5
        Accept-Encoding: gzip,deflate
        Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
        Keep-Alive: 300
        Connection: keep-alive

... and as you can see the anchor part is not actually passed to the server.
This makes sense if you consider that the anchor is designed to position the
browser at a particular point in a page - then there is no point in passing
this to the server. More formally, this is probably documented in the HTTP
protocol - but it doesn't harm to check.

So, unfortunately - I don't think you can get the anchor from the URL as
it's never passed as part of the HTTP request. You will need to use
QueryString parameters as part of the URL, e.g.
http://www.host.tld/myapp/myaction.do?parm1=booboo instead.

Hue.

> -----Original Message-----
> From: Marius Oancea [mailto:[EMAIL PROTECTED]
> Sent: 02 September 2003 08:56
> To: Struts Users Mailing List
> Subject: How to get the url containing anchor from request
>
>
> My action is called with a url like : http://site/context/action.do#ANCHOR
>
> The question is how to get the complete url from request in a way that I
> can see the ANCHOR part too.
> I tried getServletPath(), getPathInfo() .... but no success.
>
> Any ideea ?
>
> Is that not possible ?
>
> Thanx
>     Marius
>
> --
> "Why program by hand in five days what you can spend five years
> of your life automating." - Terence Parr
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.512 / Virus Database: 309 - Release Date: 19/08/2003
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 19/08/2003


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

Reply via email to