I am building a simple form to play with different
JSP styles. I wanted to get POSt to work but found I couldn't.
When I submit the form to my JSP using GET, everything works. Everything fails using POST.
the page is very simple:
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<html>
<head><title>JSP Page</title></head>
<body>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:if test="${pageContext.request.method=='POST'}">
<p/>Congrats, you managed to POST!
</c:if>
<c:if test="${pageContext.request.method=='GET'}">
<p/>Congrats, you got GET
</c:if>
<c:if test="${pageContext.request.method=='null'}">
<p/>WTF?
</c:if>
<table border="1" bgcolor="blue">
<tr><td>company</td><td>${param["company"]}</td><td>${company}</td>
<td>${param["company"]}</td></tr>
</table>
You entered:<br>
company <c
ut value="${param.company}" /><br>
street_address: <c
ut value="${param.street_address}" /><br>
Email Address: <c
ut value="${param.contact_email}" /><br>
contact_email: <c
ut value="${param.req_id}" /><br>
modification_date: <c
ut value="${param.modification_date}" /><br>
modification_date:
<c
ut value="${current}" />
<%= request.getParameter("modification_date")%>
</body>
</html>
this is the output:
Congrats, you managed to POST!
company
You entered:
company
street_address:
Email Address:
contact_email:
modification_date:
modification_date: � null
I get this same response wether using Safari or Firefox.
I'm using the bundled
Tomcat 5.5.x server with NetBeans 4.1rc1 on OSX 10.3.
I've tried setting the form to charset=iso-8859-1 and charset=UTF-8.
Thoughts? I really want to get this working via POST.