aspose file tools*
The moose likes Struts and the fly likes Return Types in a Action class from a excute method. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Return Types in a Action class from a excute method." Watch "Return Types in a Action class from a excute method." New topic
Author

Return Types in a Action class from a excute method.

RaviNada Kiran
Ranch Hand

Joined: Jan 30, 2009
Posts: 528

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.


If you want something you never had do something which you had never done
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You *can* return whatever you want.
RaviNada Kiran
Ranch Hand

Joined: Jan 30, 2009
Posts: 528



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

Joined: Sep 29, 2008
Posts: 12617

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Return Types in a Action class from a excute method.