On Fri, January 6, 2006 4:01 pm, Craig McClanahan said:
> Or, the per-request POJO *is* the context object (which already has
> per-request lifetime).  Why have two beans instead of one?

I agree, and that is in effect what I've been doing...

I'm not able to use 1.3 yet based on some politics here, so I've had to
stick with 1.2.7.  So, what I've done on a recent project is I used my own
CoR implementation from Java Web Parts (it has some extra capabilities I
needed).  What I wound up doing is I have a single Action that all my
mappings point to.  This Action looks at the path that was requested and
fires off the appropriate chain (which may be one Command, or multiple, or
a number of subchains, whatever).  I don't use ActionForms at all, but
that one Action auto-populates the context from request, and I can turn
that off per-request, dealing with conversions and such (but not
validation, that is usually done by the first Command in the Chain).  When
its all done it stuffs the context into request so that the JSPs can
render off it using my own custom tags.

I also get dependency injection via the DependencyFilter in JWP, and for
the most part this has been useful for dealing with session-scoped data...
I keep session data to a minimum, but what does get put there is retrieved
by the filter and put in request for the Action to add to ChainContext
(most of the time it amounts to having stored a ChainContext in session,
then taking that version and copying it over into the new version that the
chain uses for the current request).  The end result is that Commands
themselves are extremely small and clean.

While I wouldn't call it ideal, it has all worked out rather well and gets
me most of what I'd want.

Frank



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

Reply via email to