Niall, the className parameter its just what I was looking for. I think the name could be a little more intuitive, like configClassName, or something like that. Now its working. Thanks for your help.
Regards, Miguel On 5/25/06, Niall Pemberton <[EMAIL PROTECTED]> wrote:
On 5/25/06, Miguel Galves <[EMAIL PROTECTED]> wrote: > Hi, > > I wrote a new controller class, which extends TileRequestProcessor, in order > to solve a problem we had with POST requests enconding (UTF-8), specially > with multipart-form requests. > > I'm now trying to pass some paremeters to the new controller, using > the set-property tag in server.xml > > <controller > processorClass="utilities.MyTilesRequestProcessor" > contentType="text/html; charset=UTF-8"> > <set-property property="teste" value="hellworld"/> > </controller> > > but its not working. I've created a setTeste method in my processor, as > showed above As a rule in general <set-property> doesn't work on the actual object being instantiated - but on the config object for that class. So for example using <set-property> for an <action> element sets a property on the ActionConfig and not the Action class. So you would add the property to ActionConfig and configure Struts to use a custom ActionConfig implementation. I haven't actually tried to do what you want but what you should be trying to do is specifying a custom ControllerConfig implementation with that property on. You can then access that property in the RequestProcessor thru' the ModuleConfig: MyControllerConfig controller = (MyControllerConfig)moduleConfig.getControllerConfig(). String teste = controller.getTeste() In your struts config you specify the ControllerConfig implementation using the className: <controller className="utilities.MyControllerConfig" processorClass="utilities.MyTilesRequestProcessor" contentType="text/html; charset=UTF-8"> <set-property property="teste" value="hellworld"/> </controller> Niall --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Miguel Galves - Engenheiro de Computação Já leu meus blogs hoje? Para geeks http://log4dev.blogspot.com Pra pessoas normais http://miguelgalves.blogspot.com "Não sabendo que era impossível, ele foi lá e fez..."