title: Sending Request to JSP file based upon AJAX POST
body: <p>I am trying to send a post request to Java servlet, execute a query based upon this value, and send the information to a jsp file. The query in entered from a text box, and when the user hits enter, I need to jump to a new page to display the value of the query. </p>
  
  <p>This is my post request to the servlet:</p>
  
  <pre><code>$.ajax({
      "type": "POST",
      // generate the request url from the query.
      // escape the query string to avoid errors caused by special characters 
      "url": "Search",
      "data": {query : query},
  
      "success": function(data) {
          console.log("normal search successful");
  
      },
      "error": function(errorData) {
          console.log("lookup ajax error")
          console.log(errorData)
      }
  })
  </code></pre>
  
  <p>I get the AJAX post with: </p>
  
  <pre><code>String title = request.getParameter("query");
  </code></pre>
  
  <p>//peform action to get results...</p>
  
  <p>then forward request to JSP page with:</p>
  
  <pre><code>request.getRequestDispatcher("movielist.jsp").forward(request, response);
  </code></pre>
  
  <p>I am getting no errors but the screen doesn't redirect to the new page in my app...</p>
  
  <p>Am I missing something major here? </p>