This is probably ripe for a Wiki entry :)

As you found out, Struts can't find an Action mapping with an anchor added
to it... it's trying to find, literally, an ActionMapping named
"someAction.do#someLabel".  You might, I suppose, be able to make that
literally your mapping path, I've never tried that, but I don't think
that's what you'd want to do even if it works.

The "typical" solution to this is a little bit of scripting on your page
like so:

<head>
<script>
  function jumpToAnchor() {
    <% if (request.getAttribute("hash") != null) { %>
      location.hash = "<%=request.getAttribute("hash")%>";
    <% } %>
  }
</script>
</head>
<body onLoad="jumpToAnchor();">

Then, instead of adding the anchor name to the forward you are requesting,
you add an attribute in your Action named "hash" to the request just
before you return the forward, with a value of the name of the anchor you
want to jump to.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Mon, August 1, 2005 5:00 am, Konrad Billewicz said:
> Hello,
>
> I would like to make a redirect (code 302) and include in the URL a HTML
> label
> name - something like "someAction.do#someLabel". Unfortunately I'm getting
> an
> error saying that action "someAction.do#someLabel" is unknown.
>
> How would you handle this problem?
>
> Best regards,
> Konrad Billewicz
>
>
>
> ---------------------------------------------------------------------
> 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