RequestProcessor is the class to which the ActionServlet delegates the bulk
of its work processing a request (ie: populate form, call Action execute,
etc...).

Struts makes it easy to replace the standard RequestProcessor with your own
implementation. Normally this would extends
org.apache.struts.action.RequestProcessor and selectively override the
methods that it is interested in modifying the behaviour of.

You specify which RequestProcessor to use in your struts-config (there can
be only one...)
Be aware that some extensions (I think Tiles is one of them) already
override it - so you would need to override their version instead of the
base one.

The node of interest in struts-config is the "controller" node. ie:
<controller
processorClass="com.unist.plot.to.subvert.struts.EvilRequestProcessor"
  locale="true"
  contentType="text/html; charset=UTF-8"
  nocache="true"
  maxFileSize="128M"
  bufferSize="8192"
  debug="5" />

The RequestProcessor has enormous power over the struts request processing
lifecycle and hence can be *very* useful to override to provide custom
processing for certain things...

It was introduced in struts 1.1 - in struts 1.0 the functionality for it was
part of the ActionServlet class itself, so if your still on 1.0.2 you need
to override that instead.

Check the docs for details:
http://jakarta.apache.org/struts/api/index.html
Though in this case the best documentation is the source code itself :-)

-----Original Message-----
From: Renato Romano [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 25 March 2003 22:17
To: [EMAIL PROTECTED]; 'Struts Users Mailing List'
Subject: RE: ActionForm reset method


Ok. That's all clear but one thing: what is RequestProcessor?

____________________________________
Renato Romano
Sistemi e Telematica S.p.A.
Calata Grazie - Vial Al Molo Giano
16127 - GENOVA

e-mail: [EMAIL PROTECTED]
Tel.:   010 2712603
_____________________________________


-----Original Message-----
From: Andrew Hill [mailto:[EMAIL PROTECTED]
Sent: marted́ 25 marzo 2003 14.49
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: RE: ActionForm reset method


Depends on what your cases are...

In my app I needed to switch it off for certain specific actions so I
created my own action mapping class with a noReset parameter , and
overrode RequestProcessor to check for that.

Needless to say I later needed something a little more dynamic - so I
also added the ability to control it with a certain query parameter
which I checked for in my base ActionForm class which all my ActionForms
extend. I then renamed all my ActionForms reset methods doReset() and
called that from the base only if the parameter was set. -at which point
I realised that I should simply have added a check for that parameter in
the RequestProcessor (thats lack of sleep for you!).

<btw>
While adding this functionality to RequestProcessor is quite simple, you
will note that it isnt there already as a feature (likewise for
conditional population). This is because the struts developers
considered it likely to cause people more problems than ... ummm ...
whats a good word ... 'unproblems', I believe they did think it okay for
people to do it themselves as if they know how they probably know what
their doing and wont get into strife... :-) <btw>

-----Original Message-----
From: Renato Romano [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 25 March 2003 21:40
To: 'Struts Users Mailing List'
Subject: ActionForm reset method


Is there any way to control the ActionForm reset method invocation ? I
need to call it "manually", only in some cases. It seems the only
alternative is to define a myReset method ... Thanks

____________________________________
Renato Romano
Sistemi e Telematica S.p.A.
Calata Grazie - Vial Al Molo Giano
16127 - GENOVA

e-mail: [EMAIL PROTECTED]
Tel.:   010 2712603
_____________________________________



---------------------------------------------------------------------
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