title: Call servlet using jquery ajax?
body: <p>i have <code>some.jsp</code> file which also contains javascript/jquery. i need to do below check in javascript part of some.jsp file.based on the condition i need to display a message/ forward the request to servlet which in turn servlet forwards to <code>other.jsp</code>.</p>
  
  <p>I wrote below code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function() {
      var isInIframe = (parent !== window);
      if (!isInIframe) {
          $.ajax({
              type: "GET",
              url: "./screenInitializer",
              success: function() {},
              error: function(ob,errStr) {
                  alert("Failed. Try Again.","error");
              }
          }); 
      }else{
          $("#accessDenied").text('Access Denied');
      }
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>I can call a servlet using jquery ajax.  forward request to jsp is not working.it is displaying a blank page instead of other.jsp. forwards request to other.jsp as below.</p>
  
  <pre><code>//Keeps some values using request.setAttribute() then forward the request
  request.getRequestDispatcher("/WEB-INF/other.jsp").forward(request, response);
  </code></pre>
  
  <p>Basically i dont want any response from ajax call. it just need to call the servlet which in turn servlet forwards to the jsp and displays <code>other.jsp</code>.all My jsps are in WEB-INF folder. Am i doing anything wrong?</p>
  
  <p>Thanks!</p>