Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference between sendError and setStatus methods...

 
Narasimha Rao B.
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
A RuntimeException is thrown and it was caught appropriately in the JSP. Now if the developer sets the status code of 5XX using setStatus method, i.e setStatus(550) and also calls the sendError() method on HttpServletRespons, Will it be any problem? What the user sees in the browser? I am sure it is not the proper way to do and it is given clearly in specs that, in case of errors don't set the status code call sendError method and set the status code in the case of normal execution.

Thanks in Advance,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic