The actionServlet serves as the controller in the MVC design pattern. The project I am working on has many action classes ,action forms and the jsp pages . There is only one actionServlet. But it has only init() and destroy() methods.
I read on the jakarta side that..
For each request made of the controller, the method process(HttpServletRequest, HttpServletResponse) will be called. This method simply determines which module should service the request and then invokes that module's RequestProcessor's process method, passing the same request and response.
We don't have any process() method declared in the actionServlet. So how it is determined that for the incoming request which action to invoke? We have one main action class which extends "org.apache.struts.action.Action" and all other actions classes extend the main action.
The fact that your ActionServlet "doesn't have" a process method led me to believe that the ORIGINAL ActionServlet class was extended without overriding the process method. This seems to be exactly the case. I recommend reading a bit about inheritance to get an understanding of what is going on.
What u said in the beginning that process will be called is true.....since struts 1.1 ,all the request processiing logic is moved to RequestProcessor class.....and each module will have its own request processor(Each holding the particular modules actionmappings and all ).now what the actionservlet does is depending on the request url it picks up the appropriate RequestProcessor and calls the process method of that ReqProcessor ...........
The introduction of ReqProcessor is just because of the developers choice of providing his own way of hadnling request .but ActionServlet in 1.1 does nothing except intialisations and transferring the request
posted 16 years ago
We don't have requestProcessors written for each module. We don't have them at all. We have lot of action classes ,form beans, JSP pages and one ActionServlet.
Can some one please let me know the flow of events.From incoming Client request till the reponse is displayed to him. How the request is passed on and hwho is responsible for which action taken? I tried to read from books but couldn't find the entire flow.
posted 16 years ago
U r totally going in some different direction .Relook in to what i said in my earlier mail.The requestProcessor is not what u provide ?? thats part of the srruts framework ......