---------------------------------------------------------------- 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!!! ---------------------------------------------------------------- Hello David, may be you implemented only the doGet() but not the doPost() method? jens > -----Ursprüngliche Nachricht----- > Von: David Molloy [mailto:[EMAIL PROTECTED]] > Gesendet am: Freitag, 17. Dezember 1999 11:30 > An: Jserv List > Betreff: POST Problems > > ---------------------------------------------------------------- > 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, > > I know Peter MacIver has been having similar problems > although I believe he > is still stuck. I'm getting problems with the POST method also: > > Take this example - I have a Html file: Simple page with a form as > follows... > <FORM NAME="ServletForm" METHOD="POST" > ACTION="http://oak.eeng.dcu.ie/Admin/CreateNewStaff"> > > Simple verification and then a call to document.ServletForm.submit() > > The servlet is simply as follows: > import java.io.*; > import javax.servlet.*; > import javax.servlet.http.*; > > public class CreateNewStaff extends HttpServlet { > PrintWriter out; > > public void doGet(HttpServletRequest req, HttpServletResponse res) > throws IOException, ServletException > { > res.setContentType("text/html"); > out = res.getWriter(); > out.println("<html>"); > out.println("<head>"); > out.println("</head>"); > out.println("<body>"); > out.println("<h1>Servlet Output</h1>"); > out.println("</body>"); > out.println("</html>"); > out.close(); > } > } > > If I open up the html file: see > http://oak.eeng.dcu.ie/Admins/newstaff.html > and submit it then I get a BAD REQUEST 400. Request the > browser can't > understand etc. > In mod_jserv.log I get: > [17/12/1999 10:19:09:573] (ERROR) ajp11: Servlet Error: POST is not > supported by this URL > > The end of jserv.log is: > [17/12/1999 10:19:09:556 GMT] Read: HUser-Agent Mozilla/4.7 > [en] (WinNT; I) > [17/12/1999 10:19:09:556 GMT] Header: User-Agent=Mozilla/4.7 > [en] (WinNT; I) > [17/12/1999 10:19:09:556 GMT] All data read. > [17/12/1999 10:19:09:556 GMT] Parsing cookies > [17/12/1999 10:19:09:557 GMT] Calling service() > [17/12/1999 10:19:09:557 GMT] Sending response headers. > [17/12/1999 10:19:09:557 GMT] Status: 400 Bad Request > [17/12/1999 10:19:09:557 GMT] Servlet-Error: POST is not > supported by this > URL > > If I simply call the servlet without the form POST etc. just > as an address > it > works fine. Likewise if I use the GET method it works fine too. > Any ideas please - feel free to try it out. It's a strange > one. Thanks. > > David Molloy > > System: > SunOS oak 5.7 Generic_106541-07 sun4u sparc SUNW,Ultra-5_10 > Running apache_1.3.9, Apache_JServ_1.0, openssl-0.9.4, > mod_ssl-2.4.8-1.3.9 > JDK1.1.8 (latest 1.1), Oracle8.1.5, JDBC. Everything is > working together > finally > apart from the POST method (the last bastion). I haven't made any > significant > changes apart from those needed to get the system all up and > running so I > don't > see how I could have 'broken' the POST method. > > > > > > -- > -------------------------------------------------------------- > 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] > -- -------------------------------------------------------------- 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]