Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Selected Reading
How to send an error code using JSP to browser?
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 −
<p>HTTP Status 407 - Need authentication!!!</p> <p><strong>type</strong> Status report</p> <p><strong>message</strong> <u>Need authentication!!!</u></p> <p><strong>description</strong> <u>The client must first authenticate itself with the proxy (Need authentication!!!).</u></p> <p>Apache Tomcat/5.5.29</p>
Advertisements
