This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes send header response as 500 via JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "send header response as 500 via JSP" Watch "send header response as 500 via JSP" New topic
Author

send header response as 500 via JSP

siva kumar
Ranch Hand

Joined: May 02, 2004
Posts: 120
Hi Fellow Ranchers,

Greetings...

I am trying to develop a JSP which would send a http response of 500 Server error

public void setHeader(java.lang.String name, java.lang.String value);
public void addHeader(java.lang.String name, java.lang.String value);

I am trying to use the following methords to set the http header response, can any one suggest what should use as key value pair

So when browser gets my page it is getting http 500 server error

rather than 200 OK status.

Thanks in advance.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41149
    
  45
Instead of setting headers manually, use the response.sendError method.


Ping & DNS - my free Android networking tools app
 
 
subject: send header response as 500 via JSP
 
Similar Threads
EL function example from Hanumant Deshmukh
Data Alignment
org.xml.sax.SAXException: No deserializer for{http://DefaultNamespace}ARRAYNAME</faultstring>
sending pdf file to client as byte array
response.addHeader()..doubt