title: Forward request to servlet using jquery which in turn forwards to jsp?
body: <p>I have a js file and based on the below condition I need to display a message or forward the request to servlet which in turn forwards to jsp.</p>
  
  <pre><code>var isInIframe = (parent !== window),
      if (isInIframe) {
          //Forward request to servlet
      }else {
          //Display Access denied message
      }
  </code></pre>
  
  <p>I can call a servlet using jquery ajax. But how can I forward request to servlet? once the request is forwarded to servlet then servlet will load some property files and forwards request to some.jsp as below.</p>
  
  <pre><code>//Keeps some values using request.setAttribute() then forward the request
  request.getRequestDispatcher("/WEB-INF/some.jsp").forward(request, response);
  </code></pre>
  
  <p>How can i do that?
  Thanks!</p>