This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes form validation flow Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "form validation flow" Watch "form validation flow" New topic
Author

form validation flow

Yi Zou
Greenhorn

Joined: Mar 05, 2004
Posts: 14
A newbie's question:
When using ActionForm to validate data, if there is no error generated, the controller pass the ActionForm obj to Action to further process the request.
My question is what if there is error, where does controller forward the request to?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30130
    
150

Yi,
The controller forwards you to the action/jsp specified in the "input" attribute of the action.

For the future, Struts questions are best asked in our Web Applications Frameworks forum down below.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

I am moving this thread to the more appropriate Web Application Frameworks.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
Originally posted by Yi Zou:
A newbie's question:
When using ActionForm to validate data, if there is no error generated, the controller pass the ActionForm obj to Action to further process the request.
My question is what if there is error, where does controller forward the request to?



if you use validate() method in ActionForm like this






When have some error in this method , you MUST config page/url for next page in application like this



Finally you should be created mehod for check error in Action Class like this




Thai will help you.


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
 
 
subject: form validation flow
 
Similar Threads
Bert Bates-Struts Sample Appliation code
form to jsp request object is lost
Topic: Struts and MVC. Question: how usually are working you?
action class
Is ActionForm is part of controller or view