title: web.xml : URL mapping
body: <p>I have these two lines in my <code>web.xml</code><br><br>
  <code>&lt;url-pattern&gt;/&lt;/url-pattern&gt; : Index Servlet</code><br>and<br>
  <code>&lt;url-pattern&gt;/login&lt;/url-pattern&gt; : Login Servlet</code><br><br>
  but whem I open <code>http://localhost:8084/login/</code>, it goes to <code>Index Servlet</code> and when I open <code>http://localhost:8084/login</code>, it goes to <code>Login Servlet</code>.<br><br>
  Is there any difference in <code>http://localhost:8084/login/</code> and <code>http://localhost:8084/login</code>?<br><br>
  My <code>web.xml</code><br>
  <pre>
  &lt;servlet&gt;
      &lt;servlet-name&gt;Index&lt;/servlet-name&gt;
      &lt;servlet-class&gt;Index&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  &lt;servlet&gt;
      &lt;servlet-name&gt;Login&lt;/servlet-name&gt;
      &lt;servlet-class&gt;Login&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  </pre>and<br></p>
  
  <pre>
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Index&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Login&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/login&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </pre>