jQuery in Action, 3rd edition
The moose likes Struts and the fly likes Forwards Tiles & Anchors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Forwards Tiles & Anchors" Watch "Forwards Tiles & Anchors" New topic

Forwards Tiles & Anchors

Kye nos

Joined: Aug 01, 2006
Posts: 1
So, here is my dilemma...

I have a Struts based web app, that uses tiles. My action is smart enough
to know when I need to use a specific bookmark (i.e. target; <a id="name"></a>
as a part of the URL. After some research, I found the simplest [i]complicated[i]
solution to a simple problem is to clone the forward and modify the path
as follows:

ActionForward af = new ActionForward(mapping.findForward("success"));

af.setPath(af.getPath() + "?#name");

return af;

This works fine for normal struts actions that forward to a jsp page.
Unfortunately, I have a tiles definition in my "path" attribute of the
action instead of a url, as such:

<action path="/*WizardPage2" type="com.web.struts.actions.{1}Action" parameter="wizardPage2" name="{1}WizardForm" scope="session" validate="true" input="/{1}WizardPage1.do">
<forward name="success" path=".view.wizardPage2.{1}"/>

Due to this, I get the following error:

[2006-08-01 12:14:41,110] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/context].[action] Servlet.service() for servlet action threw exception
java.lang.IllegalArgumentException: Path .view.wizardPage2.Ops?#selectType does not start with a "/" character

Any ideas?
I agree. Here's the link: http://aspose.com/file-tools
subject: Forwards Tiles & Anchors
It's not a secret anymore!