• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Forwards Tiles & Anchors

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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}"/>
</action>

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?
 
Shiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic