----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files. Don't make us guess your problem!!!
----------------------------------------------------------------
Hi,
1 Introduction
--------------
I am using the following builds:
Apache : 1.3.9, DSO support
JServ : cvs build Apache-JServ-19991123, latest stream
Solaris : 2.7
Notes
i. "com.gtnet.RS" is my package URL
ii. "socket" is my socket connection, and works fine for GET and DELETE
iii. "/servlets" is the directory containing the servlet - RS jar file.
iv. My host name is "lewis"
My servlet, RS, is a jar file, which I am able to call the HTTP GET and DELETE
methods, but a different story with the POST method.
2 Error Message
---------------
I am getting the following error message, which I'm directing to stdout:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>400 Bad Request</TITLE>
</HEAD><BODY>
<H1>Bad Request</H1>
Your browser sent a request that this server could not understand.<P>
<HR>
<ADDRESS>Apache/1.3.9 Server at lewis Port 8080</ADDRESS>
</BODY></HTML>
2 Servlet doPost method
-----------------------
In my RS servlet, I do have a simple doPost method:
public void doPost( HttpServletRequest request,
HttpServletResponse response )
throws ServletException, IOException
{
// set content type and other response header fields first
response.setContentType("text/html");
// then write the data of the response
PrintWriter out = response.getWriter();
out.println("doPost" );
out.close();
}
3 Client Code
-------------
public void postFile( )
{
try {
String servlet = "/servlets/com.gtnet.RS.RS";
String content = "this is the contents";
BufferedWriter bw = new BufferedWriter(new
OutputStreamWriter(socket.getOutputStream()));
bw.write("POST " + servlet);
bw.write("\n");
bw.write("Content-length:" + content.length());
bw.write("\n");
bw.write("\n");
bw.write(content);
bw.flush();
}
catch(IOException e)
{
;
}
}
4 Log Files
-----------
mod_jserv.log:
[15/12/1999 10:17:06:680] (ERROR) ajp12: Servlet Error: POST is not supported by this
URL
access_log:
10.77.62.48 - - [15/Dec/1999:10:17:06 +0000] "POST /servlets/com.gtnet.RS.RS" 400 -
5 Help required
---------------
Does anyone know why the POST method is not being supported ?????
thanks
pmi
String content = "this is the contents";
BufferedWriter bw = new BufferedWriter(new
OutputStreamWriter(socket.getOutputStream()));
bw.write("POST " + servlet);
bw.write("\n");
bw.write("Content-length:" + content.length());
bw.write("\n");
bw.write("\n");
bw.write(content);
bw.flush();
}
catch(IOException e)
{
;
}
}
4 Log Files
-----------
mod_jserv.log:
[15/12/1999 10:17:06:680] (ERROR) ajp12: Servlet Error: POST is not supported by this
URL
access_log:
10.77.62.48 - - [15/Dec/1999:10:17:06 +0000] "POST /servlets/com.gtnet.RS.RS" 400 -
5 Help required
---------------
Does anyone know why the POST method is not being supported ?????
thanks
pmi
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]