Following example shows how a 407 error code is sent to the client browser. After this, the browser would show you "Need authentication!!!" message.
<html> <head> <title>Setting HTTP Status Code</title> </head> <body> <% // Set error code and reason. response.sendError(407, "Need authentication!!!" ); %> </body> </html>
You will receive the following output −
HTTP Status 407 - Need authentication!!!
type Status report
message Need authentication!!!
description The client must first authenticate itself with the proxy (Need authentication!!!).
Apache Tomcat/5.5.29