I didn't get any response to this last time so I'm asking again... :-)

I'd like to replace URLs like this:

  /Sections/Subsections/?section=Section1&subsection=SubSection1

with URLs like this:

  /Sections/Section1/Subsections/Subsection1

An action mapping like this will match that URL:

  <action path="/Sections/*/Subsections/*"
          type="org.apache.struts.actions.ForwardAction"
          parameter=".tiles.mytile"/>

The problem is, there's then no way to get what the wildcards matched in the view (JSP). For reasons discussed elsewhere I don't want to put a different action in front of each view, so I need a more general solution.

I'd like to sub-class ForwardAction and put the wildcard matches from the URL into a map which can then go into request context. But how can I pass the matches *into* the action? I can't user the 'parameter' attribute since it's already used to specify where to forward to.

I thought about this:

  <action path="/Sections/*/Subsections/*"
          type="org.apache.struts.actions.ForwardAction"
          parameter=".tiles.mytile">
    <set-property property="extraInfo"
                  value="section={1},subsection={2}"/>
  </action>

But the wildcard URL matching stops working if I do that and anyway I don't think dereferencing the matches would work in that context.

So, any other suggestions? The only thing I can think of right now is overloading 'parameter', something like

  parameter=".tiles.mytile;section={1},subsection={2}"

and doing the necessary fixup in my action class. Can anyone suggest anything better?

L.


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

Reply via email to