See below...
"gilgantic" <gi*******@yahoo.com> wrote in message
news:d6**************************@posting.google.c om...
Few random questions about Struts:
(Note: I left out ActionServlet and Model classes out of my questions)
1. Should every JSP have one "ActionForm" and "Action" class associated
with it?
Normally, yes. If your JSP has a <form> tag and POST, then you should have
an ActionForm for validation of the form data and an Action to process the
form.
2. Is Action-to-Action (Action Chaining) possible? If so, is it a good
practice?
An Action class is just a hybrid Servlet, so and Action class can call
another action class. Typically, you would call another JSP to display
results, etc. We have used Actions to call another Action in special cases
(like passing data from a process type Action to an Action that generates a
list of that data).
3. Is the normal flow JSP (POST)-> Action -> ActionForward ->
ActionForm -> JSP?
The processing flow is JSP -> ActionServlet -> ActionForm -> Action -> JSP.
ActionServlet (the Controller) is called behind-the-scenes via your mapping
in struts-config.xml, which in turn calls your ActionForm. The ActionForm
(just a JavaBean container for data) must be loaded with the data from your
JSP so the Action can "execute" it.