Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

return null from dispatch action

 
subodh gupta
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

What will happen if i'll return null from my action/dispatch action class is it right thing to do?
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that nothing will be returned to the client that initiated the request
 
subodh gupta
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic