This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Other Java Products and Servers and the fly likes Wierd problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "Wierd problem " Watch "Wierd problem " New topic
Author

Wierd problem

saquib nisar
Greenhorn

Joined: Nov 13, 2000
Posts: 14
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);
}
}
 
Don't get me started about those stupid light bulbs.
 
subject: Wierd problem
 
Similar Threads
Progress bar on IE6
Wierd problem
can a servlet do POST or what?
Internal service error..
Getting a value from a checkbox