Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

send header response as 500 via JSP

 
siva kumar
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Instead of setting headers manually, use the response.sendError method.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic