You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by "Peter A. Pilgrim" <pe...@xenonsoft.demon.co.uk> on 2003/02/12 01:02:59 UTC
Forcing or replacing a request processor version 1.1 beta3
Hi
I am looking at the Struts source code. I want to find
out the ActionServlet that is responsible for loading
and setting the RequestProcessor.
I see a ControllerConfig in the utility with the default
"org.apache.struts.action.RequestProcessor". Is there
a way of overriding this hard setting programmatical?
I want to create an ActionServlet subclass that will
default to a CustomRequestProcessor without having
to set it in XML config.
Also in the `ActionServlet.initModuleConfig' which
I think is responsible for initialisation all
the module configuration from the XML I was thinking
I could do something like this:
// Parse the configuration for this module
ModuleConfig config = null;
InputStream input = null;
String mapping = null;
try {
//@todo & FIXME replace with a FactoryMethod
ModuleConfigFactory factoryObject =
ModuleConfigFactory.createFactory();
config = factoryObject.createModuleConfig(prefix);
ControllerConfig cc =
moduleConfig.getControllerConfig();
if ( cc.getProcessorClass().equals(
"org.apache.struts.action.RequestProcessor" ) )
cc.setProcessorClass("com.xenonsoft.fire.MyCustomProcessor");
Is this a good idea?
Tia
--
Peter Pilgrim
__ _____ _____ _____
/ //__ // ___// ___/ + Serverside Java
/ /___/ // /__ / /__ + Struts
/ // ___// ___// ___/ + Expresso Committer
__/ // /__ / /__ / /__ + Independent Contractor
/___//____//____//____/ + Intrinsic Motivation
On Line Resume
||
\\===> `` http://www.xenonsoft.demon.co.uk/no-it-striker.html ''
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org