Craig,

I just don't (yet) see how or where you can set an action override. Am I
supposed to add a chain called "servlet-complete-preprocess" and put my own
code in to figure out what action is being invoked and somehow which chain I
want to call next?  I guess I was expecting something in the
struts-config.xml via a set-property or something that easy to suggest where
or how to chain it.  I suppose this means I need more reading.  Can you
suggest any links?

Regards,
David

-----Original Message-----
From: Craig McClanahan [mailto:[EMAIL PROTECTED]
Sent: Friday, October 22, 2004 9:39 PM
To: Struts Users Mailing List
Subject: Re: [Struts-Chain] how to use another chain for preprocessing?


The code that is in the repository now has focused on providing a
chain implementation that is fundamentally backwards compatible with
existing Struts 1.1/1.2 functionality.  As such, it emulates the
current RequestProcessor architecture by passng all requests through a
single commonly configured pipeline (which can, of course, be
customized).

Going beyond strict backwards compatibility, there's lots of options:

* A chain can already invoke another chain using the generic LookupCommand
  capability.  The "other" chain's name can be determined either
literally (via the
  "name" property) or indirectly (via the "nameKey" property, naming a
context
  property where some other processing logic has stored the name of the
chain
  to be executed).

* Given this, it would be trivial, for example, to create a chain equivalent
to
  the standard DispatchAction, which based the name of the chain to run on
some
  request parameter, or other incomding characteristic on the request.
  In the "servlet-standard" chain, this technique is used to execute a
  user-defined preprocess chain if there is one, ignoring it otherwise.

* Alternatively, it would be possible to set things up so that the name of
the
  action implicitly selects a correspondingly named chain (if there is one);
  defaulting to the standard chain if there is nothing special.  That way
you
  could customize the processing of individual actions without having to
  affect all of them.

* Regarding chaining of actions themselves, if you are using the standard
  request processing chain that remains as bad an idea as it has always
  been in Struts, and I don't see any reason to make it easier with chaining
  than it is today.  Instead, a different approach is likely to be better --
for
  example, building a chain that forwards to a view named "foo" could
  automatically look up a setup chain (specific to that view) and execute
  it if it's there.  This would likely eliminate many occurrences of the
"setup
  action --> view --> process action" design that you see in lots of
Struts code.

What a chain does is totally up to who designs the chain.  Once you
free yourself from a requirement to be backwards compatible (leaving
the existing servlet-standard chain there for people that *do* want
that), there's a lot of room to innovate.  So, the answer to nearly
all of yor questions is "yes, you can do that if you want to."

Craig


On Fri, 22 Oct 2004 20:23:28 -0400, David G. Friedman
<[EMAIL PROTECTED]> wrote:
> I'm curious about Struts-Chain and have read through the 1.2.4 source on
it
> plus the 1.3 SVN repository.  I don't see anything suggesting how to make
my
> action chain itself to another action in the struts-config.xml example.
Nor
> do I see anything suggesting how to have an action be processed by a chain
> other than the default chain.  Is struts-chain supposed to be as one chain
> per web.xml pattern matching?  Are the chains supposed to do that and use
a
> common struts configuration object? (I.e. Just /do/whatever invokes chain
a
> but mapping /dothis/whatever3 invokes a different chain?
>
> Thanks for any help.
>
> Regards,
> David the Curious ([EMAIL PROTECTED])
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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


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

Reply via email to