Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Struts
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Struts
Extending RequestProcessor
Skanda Raman
Ranch Hand
Posts: 205
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I am trying to extend RequestProcessor to use custom request processor.
Compilation of below code was successful.
package com.struts.action; import org.apache.struts.action.RequestProcessor; import javax.servlet.http.*; public class UserRequestProcessor extends RequestProcessor { public boolean processPreprocess(HttpServletRequest req,HttpServletResponse res){ System.out.println("Adding to Logs..."); log("-----------processPreprocess Logging-------------"); log("Request URI = " + req.getRequestURI()); log("Context Path = " + req.getContextPath()); return true; } }
Then i added the below lines to struts-config.xml file and restarted the application
<controller> <set-property property="processorClass" value="com.struts.action.UserRequestProcessor"/> </controller>
Now, i do not find the logs written to file and also the SOP i added in above code is not displaying in console.
I am using jboss-4.0.0 application server.
Can you please let me know if i am doing any thing wrong in customizing the processor.
Thanks in advance
Skanda
Ankit Garg
Sheriff
Posts: 9707
43
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
If you just want to do logging, you might use an interceptor. Also I'm not sure but the log method was depricated I think (as per the documentation), so that may be a reason that it's not working...
SCJP 6 | SCWCD 5 |
Javaranch SCJP FAQ
|
SCWCD Links
David Newton
Author
Posts: 12617
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Interceptors are for
Struts
2.
I'd consider using Log4J, Commons Logging (which can wrap Log4J), or similar rather than trying to use the built-in logging.
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Facing problem in struts application
Struts bookmark question
Session out in Struts
Using custom request processor and Tile framework
Spring new bie problem
More...