title: how to link external js file in jsp
body: <p>Went through other similar question on SO, but unable to fix my issue. I have written <code>src</code> path inside <code>script</code> tag.</p>
  
  <p>Below is the program:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>    function validate()
      {
          var fname = document.myForm.fname.value;
          var lname = document.myForm.lname.value;
          
          if(fname=="" &amp;&amp; lname=="")
          {
              alert("First and last name cannot be emtpy");
              return false;
          }
      }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
          &lt;head&gt;
              &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
              &lt;script src="/js/validation.js"&gt;&lt;/script&gt;
              &lt;title&gt;Registration Form&lt;/title&gt;
          &lt;/head&gt;
          &lt;body&gt;
              &lt;form name="myForm" action="RegistrationServlet.do" method="POST" onsubmit="return validate()"&gt;
              First name:&lt;input type="text" name="fname" /&gt; &lt;br/&gt;
              Last name:&lt;input type="text" name="lname" /&gt;&lt;br/&gt;
              Gender: Male&lt;input type="radio" name="male" /&gt; Female&lt;input type="radio" name="male" /&gt;&lt;br/&gt;
              Mobile:&lt;input type="tel" name="mobile" /&gt;&lt;br/&gt;
              Email:&lt;input type="email" name="email" /&gt;&lt;br/&gt;
              Address:&lt;textarea name="tarea"&gt;&lt;/textarea&gt;&lt;br/&gt;
              Street:&lt;input type="text" name="street" /&gt;&lt;br/&gt;
              Area:&lt;input type="text" name="area" /&gt;&lt;br/&gt;
              
              City:&lt;select&gt;
                  &lt;option value="hyderabad"&gt;hyderabad&lt;/option&gt;
                  &lt;option value="secunderabad"&gt;secunderabad&lt;/option&gt;
                  &lt;option value="delhi"&gt;delhi&lt;/option&gt;
                  &lt;option value="mumbai"&gt;mumbai&lt;/option&gt;
              &lt;/select&gt;
      
              State: &lt;input type="text" name="state" /&gt;&lt;br/&gt;
              Country: &lt;input type="text" name="country" /&gt;&lt;br/&gt;
              Pin: &lt;input type="text" name="pin" /&gt;&lt;br/&gt;
              &lt;input type="submit" value="Submit" /&gt;
              &lt;/form&gt;
          &lt;/body&gt;
      &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>My js file is in the folder called js inside the webapp directory</p>