title: redirect from jsp using scriplet code
body: <p>My application has a JSP, which uses scriplet code to redirect to a page based on some condition.   </p>
  
  <p>But what is happening is that, after the redirect code <code>response.redirect(..)</code>, the below code is executing. I don't want to execute below code or load the JSP page, I just want to redirect immediately. See the below example and please let me know the solution.</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;%
      boolean condition = true;
      if(condition)
          response.sendRedirect("http://www.google.co.in");
      System.out.println("I don't want to execute this code, I just want to redirect after above line");
  %&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>