What is the nature of the messages you want to log?  Is it something basic
like "Request received", or do you need values from ActionMapping or
something?  If they are simple messages, and if you really need it for all
requests, I would suggest a filter.  Very easy, and not coupled to the
framework at all.

Frank

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

On Mon, May 8, 2006 11:51 am, Philihp Busby said:
> You could extend one of the methods in RequestProcessor, like this:
>
> public class AuditingRequestProcessor {
>   protected ActionForward processActionPerform(
>       HttpServletRequest request,
>       HttpServletResponse response,
>       Action action,
>       ActionForm form,
>       ActionMapping mapping
>       ) throws IOException, ServletException {
>
>     //TODO: call your logs and display audit messages here.
>
>     return super.processActionPerform(request, response, action, form,
> mapping);
>   }
> }
>
> The only change you would need to make to your existing application
> would be to add the following to your struts-config.xml.
>
> <controller>
>   <set-property property="processorClass"
> value="com.package.AuditingRequestProcessor"/>
> </controller>
>
> @see
> http://struts.apache.org/struts-doc-1.2.x/userGuide/building_controller.html#request_processor
>
> You may have to stack your preprocessor on top of another (such as the
> Tiles one) if your application already has a custom controller.
>
> This would be advantageous over extending Action if you already have a
> lot of Action classes written and can't (i.e. don't want to) modify
> them, or if co-developers can't (i.e. don't want to) remember to
> extend your abstract Action.
>
> On 5/8/06, Ed Griebel <[EMAIL PROTECTED]> wrote:
>> You can create a base action class which extends Action and implements
>> execute(). In execute you would call your preferred logging method as
>> described below. Then, every action you create would extend your
>> BaseAction class and the first line of every execute() method would
>> call super.execute()
>>
>> -ed
>>
>> On 5/8/06, Adam Hardy <[EMAIL PROTECTED]> wrote:
>> > Srinivas Vakkalanka on 08/05/06 11:32, wrote:
>> > > Hi,
>> > >
>> > >  I am new to struts. I have a request that, for every request I want
>> to
>> > > display a message or log a message using struts frame work. How this
>> could
>> > > achieve. Please help in this regard
>> >
>> >
>> > Hi Srinivas,
>> > your requirement would normally be implemented using your logging
>> > component (commons-logging would be a good first choice). You code
>> > against the logging API and you control where it puts the output via
>> the
>> > configuration. Check out the jakarta website and look for commons, and
>> > then the logging subproject. They have a useful 'quickstart' section
>> in
>> > their docs online.
>> >
>> >
>> > Adam
>> >
>> > ---------------------------------------------------------------------
>> > 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]
>>
>>
>


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

Reply via email to