jQuery in Action, 2nd edition*
The moose likes Struts and the fly likes Struts2- About the return type on to the execute Method in Action class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2- About the return type on to the execute Method in Action class" Watch "Struts2- About the return type on to the execute Method in Action class" New topic
Author

Struts2- About the return type on to the execute Method in Action class

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234


Hi ,

As per a tutorial on one of the site :

INPUT is returned when the action requires more input from the user.


I did not understand the above Point .


(As per my understanding INPUT is applicable when we are doing validation inside the execute Method itself , please correct me if i am wrong)
Can anybody please tell me when should i use return type as "INPUT" inside the execute method of an Action class ??


Save India From Corruption - Anna Hazare.
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9293
    
  17

Generally validation is not handled inside the execute method so you don't need to return input from the execute method. If you use struts 2 validation (info here) or use a simple validate method (example) for your data, then the validation interceptor will validate your data and if there are any validation errors, then the workflow interceptor will automatically send you to the input page...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

As an example, "input" might be returned if a requested resource isn't found, allowing the user to re-enter search information.
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Thank you Ankit and David.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts2- About the return type on to the execute Method in Action class