On Fri, 14 Feb 2003, PILGRIM, Peter, FM wrote:

> >
> > Am I missing something, or can't you just say:
> >
> >   <controller processorClass="com.mycompany.MyRequestProcessor"/>
> >
> > and be done with it?
>
> Craig
>
> I certainly could do that and I am doing that, but I want to
> force the custom request processor,
> because I am package Struts as part of Expresso?
>

How about defining an ExpressoPlugIn that configures everything you need
at startup time?  PlugIns run after the struts-config.xml file has been
digested, but before the configuration information is frozen, so they can
do things like:

  ModuleConfig modConfig =
    servlet.getServletContext().getAttribute(Globals.APPLICATION_KEY);
  ControllerConfig contConfig = modConfig.getControllerConfig();
  contConfig.setProcessorClass("com.mycompany.MyRequestProcessor");

This technique can be used for pretty much any sort of modifications to
the configured information.

Another alternative (recently added in the 1.1 tree) is to add some
Digester rules that are included in the set used to parse
struts-config.xml (see the "rulesets" init parameter on ActionServlet).
If you couple that with turning validation off, you can even add
additional configuration elements and attributes into the standard config
file -- I think the STXX folks are planning to take advantage of this to
define their processing pipelines inside an <action> element.

Craig

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

Reply via email to