• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Wierd problem

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Below is a very simple example servlet, which generates a form, with 1 input field, and a submit button. Is re-posts to itself.
If I run using a local Tomcat/Apache server it works fine, I can submit the form as many times as I want.
However, when I run via our IPlanet webserver, the first submit works, but the second submit give a error message:
Bad request
Your browser sent a query this server could not understand.
The code is:
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class testform extends HttpServlet {

public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {

response.setContentType("text/html");
PrintWriter out = response.getWriter();

out.println("<HTML><HEAD><TITLE>Test form</TITLE></HEAD><BODY>");

out.println("<FORM METHOD='POST' ACTION='testform'>");

out.println("NAME:<INPUT TYPE='TEXT' NAME='name' VALUE=''>");
out.println("<INPUT TYPE='SUBMIT' NAME='SUBMIT' VALUE='SUBMIT'>");

out.println("</FORM></BODY></HTML>");
}

public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
}
}
 
I suggest huckleberry pie. But the only thing on the gluten free menu is this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic