Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Difference between sendError and setStatus methods...  RSS feed

Narasimha Rao B.
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Boost this thread!