title: JSP getParameter problem
body: <p>I have a form, if the timer reach the form will auto redirect to the Servlet to update database. My problem now is if javascript redirect the window to servlet my request.getParameter is null. </p>
  
  <pre><code>function verify(f,whichCase){
  if(whichCase == "Submit"){
      msg = "Are you sure that you want to submit this test?";
      var i = confirm(msg)
      if(i){
          parent.window.location = "sindex.jsp"
      }
     return i;
   }
  }
  </code></pre>
  
  <p>I doing this because i got a iframe in my jsp. Timer update problem have to use iframe. So, when time up or user click submit  parent.window.location can let me refresh parent window</p>
  
  <pre><code>&lt;form method="POST" action="${pageContext.request.contextPath}/TestServlet" onSubmit="return verify(this,whichPressed)"&gt;
  </code></pre>
  
  <p>My form when user click submit button within the timing, it will trigger the verify function to let user confirm submit. So inside my TestServlet i got this, because using javascript redirect request.getParameter("answer") this keep return me null.</p>
  
  <pre><code>protected void doPost(HttpServletRequest request,
  HttpServletResponse response) throws ServletException, IOException {
  if (request.getParameter("Submit") != null) {
     String ans = request.getParameter("answer");
     Answer a = new Answer(ans, no);
     aa.CreateAnswer(an,t.getTestCode(),username);
     RequestDispatcher rd = request.getRequestDispatcher("/sindex.jsp");
     rd.forward(request, response);
    }
  }
  </code></pre>
  
  <p>Below are my timer when time up redirect to TestServlet trigger the doGet method</p>
  
  <pre><code>if((mins == 0) &amp;&amp; (secs == 0)) {
  window.alert("Time is up. Press OK to submit the test."); // change timeout message as required
  var sUrl = "TestServlet";
  parent.window.location = sUrl // redirects to specified page once timer ends and ok button is pressed
  } else {
    cd = setTimeout("redo()",1000);
  }
  </code></pre>