CodesJava

Easy learning with example program codes

How to send an authentication error from a servlet?


The setStatus(statuscode) method of HttpServletResponse to send an authentication error.

//Set error code and reason.
response.sendError(407, "Need authentication!" );

Related topics

Please follow and like us:


Copyright © 2019 CodesJava DMCA.com Protection Status SiteMap Reference: Java Wiki