title: How to include HTML in JSP?
body: <p>I've searched for this question, there are some answers, but not exactly as my question. So, here is my jsp code:</p>
  <pre><code>&lt;body&gt;
      &lt;%
          if (manager.isValid(request.getParameter(&quot;username&quot;),request.getParameter(&quot;password&quot;))){
              out.print(&quot;&lt;h1&gt; Welcome &quot;);
              out.print(request.getParameter(&quot;username&quot;) + &quot;&lt;/h1&gt;&quot;);
          } else {
              out.print(&quot;&lt;h1&gt; Please Try Again &lt;/h1&gt; &lt;br /&gt;&quot;);
              out.print(&quot;Either your username or password is incorrect. Please Try again &lt;br /&gt; &lt;br /&gt;&quot;);
                          }
      %&gt;
      &lt;%@ include file=&quot;LoginForm.html&quot; %&gt;
      
  </code></pre>
  <p>but instead of this, I want to include &quot;loginForm.html&quot; only in &quot;else&quot; block.
  How can I do it?
  Of course this doesn't work, but you'll guess what I want:</p>
  <pre><code>&lt;%
          if (manager.isValid(request.getParameter(&quot;username&quot;),request.getParameter(&quot;password&quot;))){
              out.print(&quot;&lt;h1&gt; Welcome &quot;);
              out.print(request.getParameter(&quot;username&quot;) + &quot;&lt;/h1&gt;&quot;);
          } else {
              out.print(&quot;&lt;h1&gt; Please Try Again &lt;/h1&gt; &lt;br /&gt;&quot;);
              out.print(&quot;Either your username or password is incorrect. Please Try again &lt;br /&gt; &lt;br /&gt;&quot;);
              include file=&quot;LoginForm.html&quot; ;
          }
      %&gt;
  </code></pre>