QUESTION - Jonathan
Can someone tell me if there is a way to configure an action to match a path
regardless of how deep it is in a directory?

ANSWER - Ted
No. There is not a way to do this, without changing the way Struts is
programmed to behave. You could request a feature change in Bugzilla, and
bring it up on the DEV list for discussion.

==================================================================

As I was experimenting with our struts app I ran into the situation where I
wanted a generic "path-indifferent" name to trigger an action.  For
instance, in the following three cases:
"/charts/display.do"
"/news/display.do
"/events/outdoors/display.do"

I didnt care about anything except the existence of  "display.do" ANYWHERE
at the end of ANY path.  In fact, isnt this exactly how the servlet is
triggered with ".do"  This is what I expected, and the current Struts design
wont let me do this.  Do you all think this is an important feature?  I
really would like it as it can give a sense that the behaviour is common,
and saves me time in thinking about how to properly trigger that particular
action I was wanting.



>
> Jonathan Asbell wrote:
> >
> > I think you may have misunderstood the problem.  ".do" IS triggered, but
the
> > Struts mapping object registered under the "path" may not be found.  In
> > other words consider:
> >
> > "/charts/display.do"
> > "/news/display.do
> > "/events/outdoors/display.do"
> >
> > I want ANY occurence of  "display.do" in the path to trigger a
particular
> > mapping
> >
> > ----- Original Message -----
> > From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>; "Jonathan" <[EMAIL PROTECTED]>
> > Sent: Wednesday, July 18, 2001 1:29 AM
> > Subject: Re: requirements for path triggering actions
> >
> > >
> > >
> > > On Mon, 9 Jul 2001, Jonathan wrote:
> > >
> > > > Can someone tell me if there is a way to configure an action to
match
> > > > a path regardless of how deep it is in a directory?  That is, I want
> > > > "/display.do" to be triggered in each case below:
> > > >
> > > > "/charts/display.do"
> > > > "/news/display.do
> > > > "/events/outdoors/display.do"
> > > >
> > > > How can I accomplish this?
> > > >
> > >
> > > The Servlet 2.2 (or 2.3) spec defines all the legal forms of
> > > <servlet-mapping> patterns, and can be downloaded at:
> > >
> > >   http://java.sun.com/products/servlet/download.html
> > >
> > > For your purposes, you will find that the "*.do" pattern does indeed
match
> > > all of the above.  The corresponding action paths should be
> > > "/charts/display", "/news/display", and "/events/outdoors/display".
> > >
> > > Craig McClanahan
> > >
> > >
> > >
>
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Custom Software ~ Technical Services.
> -- Tel 716 737-3463.
> -- http://www.husted.com/about/struts/
>

Reply via email to