Van wrote:
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.
This seems so obvious to me that I'm probably missing something about
your requirements. Why can't you access the
HttpServleRequest.getRequestURI() method and then process the returned
URI string in your subclass of the Struts ForwardAction? The execute
method for an Action class gets the incoming request object as one of
the parameters. Your subclass can process the URI for the section and
subsection values and set them as request attributes. For that matter,
the request object is available to your JSP pages as well:
http://tinyurl.com/9jn4d
Of course, you would have to write scriptlet logic or define a JSP
custom tag to encapsulate the logic to parse for the
section/subsection values in order to handle it directly in the JSPs.
All easily doable though. I'm just not seeing what the problem is
here.
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.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]