|
(2) CustomRequestProcessor.java file
package com.visualbuilder;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.RequestProcessor;
public class CustomRequestProcessor extends RequestProcessor {
public boolean processPreprocess(HttpServletRequest request, HttpServletResponse response) {
System.out .println("Called the preprocess method before processing the request"); return super.processPreprocess(request,response); } }
Note:- Only the above specified files are addition to the previous example i.e."Customizing the ActionServlet Class for the application".
(3) Output
The text "Called the preprocess method before processing the request" gets printed each time the request is processed by the Struts. This shows that it is calling the CustomRequestProcessor and not the RequestProcessor class. |