This is not a good idea...

As far as i'm aware anchors are not part of the http specification.  They
are only implemented in html.

Eg. You type /myAnchor.do#myAnchor into the url bar in your browser, the
browser actually requests /myAnchor.do - it doesnt send the anchor - it just
uses it to show the correct part of the page.

Now, if a browser sends a request for /myAnchor.do and recieves a redirect
to /myAnchor.do#myAnchor the browser will then make a further request - but
what should it request?

/myAnchor.do#myAnchor is an invalid url

If its clever it will spot this and either send:
/myAnchor.do (and handle the anchor)

or if it's not:
/myAnchor.do#myAnchor (and cause errors)
/myAnchor.do%23myAnchor (and cause errors)

I've come accross this problem in my own apps.  In testing Firefox and MOST
versions of IE can deal with it... but some versions of IE cause errors.

The only solution i came up with is to use forwards (not redirects) and use
javascript so that when a form is submitted, or a link is cliked it decides
which anchor to select before anything is submitted.

Daniel.



> -----Original Message-----
> From: David G. Friedman [mailto:[EMAIL PROTECTED]
> Sent: 10 November 2004 04:50
> To: Struts Users Mailing List
> Subject: RE: [Tiles] Forwarding to an specific anchor link of a Tile
>
>
> Daniel,
>
> An anchor is HTML, not Java/Struts so why don't you have your
> redirect go to
> /myAnchor.do#myAnchor ?
>
> Regards,
> David
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Sent: Friday, November 05, 2004 6:43 AM
> To: [EMAIL PROTECTED]
> Subject: [Tiles] Forwarding to an specific anchor link of a Tile
>
>
>
> Hi everybody,
>
> i need to forward from an Action to an specifig anchor link of a Tile.
>
> Something like:
>
> [example definition of Tiles configuration file]
> <definition name="myAnchor" extends="layout">
>     <put name="title" value="Struts-Tiles anchor" />
>     <put name="body" value="/itemEdit.jsp#myAnchor" />
> </definition>
>
> but as expected, Tiles engine can't locate the file.
>
> is it possible to forward from an Action to an specific anchor link of a
> Tile?
>
> Thanks in advance,
> Daniel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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

Reply via email to