- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 −
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
Advertisements
To Continue Learning Please Login
Login with Google