-
Apr 3rd, 2012, 09:26 PM
#1
submitted a form as a POST is comming into the tc server as a get on first hit
I have a simple servlet(HttpServlet) and a simple form submitting data as a POST to the servlet,
On first click the servlet is receiving the request as a get instead of a POST, but on subsiqent clicks its getting the request correctly as a POST.
Please let me know how to get this corrected.
on the javascript side, all I am doing is this
function formSubmit()
{
document.forms['myForm'].action="https://SomeURL.com/something";
document.forms['myForm'].method='POST';
document.forms['myForm'].target='_blank';
document.forms['myForm'].submit();
}
servlet code
public class MyServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
//do nothing
}
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
//do something
}
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules