Is it possible to set the response status code in Apache using JAVA

Discussion in 'Server Operation' started by vikram8522, Nov 7, 2008.

  1. vikram8522

    vikram8522 New Member

    Hi All


    Is it possible to set the response status code ,like 212,299,etc.............................
    in Apache,

    OS :windows
    Platform:java


    Thanks
     
  2. Ben

    Ben ISPConfig Developer ISPConfig Developer

    I don't know what kind of response status you mean, hopefully the rfc defined once... googling for it guides me at the second place to this link:
    http://tomcat.apache.org/tomcat-4.1-doc/catalina/docs/api/org/apache/catalina/HttpResponse.html

    Or especially do you mean by "using Java"?

    But generally said, you may do it on serverside by setting the http-response-header in an appropriate way, as an example in php would look like this to send a 404 error:

    Code:
    header("HTTP/1.0 404 Not Found");
    
    hth
     
  3. vikram8522

    vikram8522 New Member

    reply of post

    Thanks for reply

    No it doesn't mean to set the response like 404..................

    I tried to do it by setting in my code

    response.setStatus(212);

    it returns 500 ,but works fine when I am sending a response like 200 to 207 or 300 to 307 or 400 to 426 which are predefine status codes in Apache.
     
    Last edited: Nov 7, 2008

Share This Page