- Trending Categories
- Data Structure
- Operating System
- MS Excel
- C Programming
- 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!!!).
- Related Articles
- How to create a common error page using JSP?
- How to send a html based email using a JSP page?
- How to send a email with attachment using a JSP page?
- How to handle error object in JSP using JSTL tags?
- How to send a simple text based email using a JSP page?
- How to send private messages from twitter to a browser
- How to avoid Java code in jsp page?
- How to send the result of Python CGI script to the browser?
- How to send an attachment in email using Swift?
- How to share code between Node.js and the browser?
- Sending HTTP error code using Express.js
- How to send an attachment in email using Swift(ios)?
- How to send an object one Android activity to another using Intents?
- How to send email using PowerShell?
- How to connect to an already open browser using Selenium Webdriver?