struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank W. Zammetti" <>
Subject Re: RequestProcessor/Dispatcher & render page
Date Sun, 16 Oct 2005 19:05:55 GMT
Take a look at the RequestProcessor class source (pre-1.3 Struts, I'm 
looking at 1.2.4 at the moment).  Look for the process() method.  This 
is, in a high-level way, where most of the work occurs in the request 
processing cycle (at least the part that you are likely to be concerned 
with).  Specifically, near the end you'll see this:

   // Call the Action instance itself
   ActionForward forward = processActionPerform(request, response, 

     action, form, mapping);

As the comment pretty clearly states, this is where the execute() that 
you as the app developer write is called.  The forward you return is 
grabbed.  Next, you'll see this:

   // Process the returned ActionForward instance
   processForwardConfig(request, response, forward);

The processForwarConfig() is where the forward (or redirect) occurs.  In 
that method, forward.getPath() is called, which returns the path to 
forward to, based on the configuration read in from struts-config.xml 
when ActionServlet started up, and RequestDispatcher is used to forward 
(or response.sendRedirect() for a redirect).

Have I answered the question, or did I not understand what you were asking?


devosc wrote:
> Hi,
> How does Java/Struts determine when/how to render a page fro the
> current findForward path ? For some reason I cant seem to determine
> how the RequestDispatcher is directly invoking the this target path
> without failing in the processMapping method of RequestProcessor ?
> For example, in a demo, its flow is index.html->index.jsp--> forward
> to /main --> action findforward --> main.jsp, but I cant see how it
> knows when/what to do with path=/main.jsp
> --
> devosc
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:
> .

Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
AIM: fzammetti
Yahoo: fzammetti

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message