By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,937 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

Struts Novice: Using Action/ActionForms?

P: n/a
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?
2. Is Action-to-Action (Action Chaining) possible? If so, is it a good practice?
3. Is the normal flow JSP (POST)-> Action -> ActionForward -> ActionForm -> JSP?
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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.
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.