I've been meaning to put together a patch to make modules work with URL
prefix mapping. This would fit in naturally with that. But I don't know
when I'll find time to get to that so if you have a chance to look at this
first, feel free ;-)
L.
Frank W. Zammetti wrote:
Not sure :) I personally would consider it a bug :)
I made a Wiki entry for this yesterday by the way, so at least there is
documentation of it now. I agree though that it shouldn't be a big
change and would be nice to "fix" it (or, alter the feature, depending
on what it is!).
Want to throw a patch up Laurie? If not, I think I could squeeze in
time to write the 3-5 lines of code it'd likely be :)
Frank
Laurie Harper wrote:
Ouch, is that considered a feature or a bug? :-) It probably wouldn't
be hard to change Struts to ignore the anchor if such a change were
acceptable.
L.
Frank W. Zammetti wrote:
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.
--
Laurie, Open Source advocate, Java geek and novice blogger:
http://www.holoweb.net/laurie
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]