On 6/14/05, Laurie Harper <[EMAIL PROTECTED]> wrote:
> The problem with that approach is duplication of information: you have
> to know the URL structure in the action / tag / whatever that does the
> URL parsing, as well as in struts-config.xml. And I don't need a single
> pattern, there would be a number of them, so the URL parsing would
> quickly get messy.
> 
> L.

You are starting to lose me here. To quote your original example:

<QUOTE>
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.
</QUOTE>

Okay. So maybe this isn't the only wildcard mapping you will have.
Still, you could have one SectionAction class for this particular
wildcard mapping. That would be a vast improvement over status quo.

How many different wildcard mappings do you have in this application?
You could pass one request parameter that indicated which wildcard
pattern was involved. If you don't want to have branching logic, you
could even make this additional request parameter be a property name
and store in your application properties file the regular expression
to use against the incoming request URL to pull out the matching
wildcard values. That should scale generally to any number of
different wildcard mappings using a single Action class that was
driven by these regular expressions coming from your application
properties file.

-Van

-- 
- Mike "Van" Riper
  [EMAIL PROTECTED]

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

Reply via email to