Well you also get a default execute method which returns success, so you can create empty actions if there is no business logic. It also implements a lot of interfaces like TextProvider for your convenience. Look at the ActionSupport documentation...
Well there is a Map of validation errors in the ActionSupport class. So when you call the addFieldError method, your field name is added as the key to a new entry in the map and the message is added as a value to the new entry. It goes like this
The original code might not look exactly like this in ActionSupport class but this is just the concept...
PavanPL KalyanK
Ranch Hand
Joined: Feb 28, 2009
Posts: 212
posted
0
Thanks Ankit .
But i was an expecting a answer in terms of workflowinterceptor which automatically does the work . If you know this can you please give an idea on this .
Well I couldn't understand your question properly, but the workflow interceptor calls the ActionSupport.hasFieldErrors() to check if there were any errors during call to validate method and if that method returns true, then workflow interceptor stops the execution of the request and returns the input page configured for that action to the user...
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12612
posted
0
All of the validation and I18N is implemented by ActionSupport; if you don't extend it, and you want validation and I18N to work, you must implement it all yourself, which seems like a lot of work for something that's already provided.
PavanPL KalyanK
Ranch Hand
Joined: Feb 28, 2009
Posts: 212
posted
0
Thanks Ankit and David for your great explanation
Mare Eswaran
Greenhorn
Joined: Feb 10, 2012
Posts: 2
posted
0
Thats really a useful reply..
subject: Struts2 whats the need for extending ActionSupport class