• Post Reply Bookmark Topic Watch Topic
  • New Topic

How can I force a 401 response code instead of a 500?  RSS feed

 
James Adams
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a filter which performs authentication on requests. Currently I throw a ServletException in the case where the request fails to authenticate. This results in a 500 response code, and instead I'd like to have a 401 (Unauthorized) response code in this case. Is there a way to do this?

Thanks in advance for your help.

--James
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you gander at the API for the response object?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!