GeeCON Prague 2014*
The moose likes Struts and the fly likes return null from dispatch action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "return null from dispatch action" Watch "return null from dispatch action" New topic
Author

return null from dispatch action

subodh gupta
Ranch Hand

Joined: Jul 23, 2007
Posts: 203
Hi Ranchers,

What will happen if i'll return null from my action/dispatch action class is it right thing to do?


http://subodh-gupta.blogspot.com
Michael Ku
Ranch Hand

Joined: Apr 20, 2002
Posts: 510
I think that nothing will be returned to the client that initiated the request
subodh gupta
Ranch Hand

Joined: Jul 23, 2007
Posts: 203
Its's returning the blank html page but it doesn't sound good to me is their any way to disable this feature if showing nothing because i like to see the exception instead.
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
If an exception is occurring in your code and you want to display information to the user about the error then you should return a mapping that directs the user to an error page.

- Brent
 
jQuery in Action, 2nd edition
 
subject: return null from dispatch action