• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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 ??
 
Ankit Garg
Sheriff
Posts: 9578
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Ankit and David.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic