This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Servlets and the fly likes Sending HTTP status code to browser through servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Sending HTTP status code to browser through servlet" Watch "Sending HTTP status code to browser through servlet" New topic
Author

Sending HTTP status code to browser through servlet

Pranav Pal
Ranch Hand

Joined: Nov 04, 2007
Posts: 74
How HTTP status code can be sent to browser through servlet?
Thanks in advance


Hakuna Matata!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41629
    
  55
All the relevant methods are part of javax.servlet.http.HttpServletResponse.


Ping & DNS - my free Android networking tools app
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Ulf Dittmer:
All the relevant methods are part of javax.servlet.http.HttpServletResponse.


http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServletResponse.html#setStatus(int)
Also notice that, at the top of the API page, there is a list of constants defined representing each of the status codes.
[ December 07, 2007: Message edited by: Ben Souther ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Sending HTTP status code to browser through servlet