Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Return Types in a Action class from a excute method.

 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Why struts2 designers has provided the limitation in only allowing return types as error , login , success , input .

Why had they limited this rather than allowing the developer to return whatever he want ??

Please Help.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You *can* return whatever you want.
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



But the docs say different thing??

SUCCESS. Indicates that the action execution was successful and the result view should be shown to the user.

• NONE. Indicates that the action execution was successful but no result view should be shown to the user.

• ERROR. Indicates that that action execution failed and an error view should be sent to the user.

• INPUT. Indicates that input validation failed and the form that had been used to take user input should be shown again.

• LOGIN. Indicates that the action could not execute because the user was not logged in and the login view should be shown.

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, the docs say that those are values pre-defined by ActionSupport (technically the Action interface). That says nothing about *having* to return them. They're result names: you can name your results "fred" if you want.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic