title: JSTL c:url tag - servlet context
body: <p>We are writing application that uses Spring MVC. Today I had little fun wit <code>c:url</code> tag in .jsp files. </p>
  
  <p>So I fought that finally it is the time to know what excatly this tag do.</p>
  
  <p>For example on this page: <a href="http://heavyz.sourceforge.net/homepage/homepage_zh/comp/notes/jstl-core.html" rel="nofollow">http://heavyz.sourceforge.net/homepage/homepage_zh/comp/notes/jstl-core.html</a> I can read that it does something like this</p>
  
  <blockquote>
    <p>Prepending the name of the current servlet context</p>
  </blockquote>
  
  <p>and</p>
  
  <blockquote>
    <p>The value attribute is used to specify a base URL, which the tag then
    transforms as necessary.  If this base URL starts with a forward
    slash, then a servlet context name will be prepended. An explicit
    context name can be provided using the context attribute.  If this
    attribute is omitted, then the name of the current servlet context
    will be used.</p>
  </blockquote>
  
  <p>but I am wondering about this <code>current servlet context</code> thing, because I have in my login form</p>
  
  <pre><code>    &lt;form name='f' action="&lt;c:url value='/j_spring_security_check' /&gt;"
      method='POST'&gt;
      &lt;fieldset&gt;
  
          &lt;div class="form_elem"&gt;
              &lt;label for="j_username"&gt;Login: &lt;/label&gt; &lt;input type="text"
                  name="j_username" value="" /&gt;
          &lt;/div&gt;
          &lt;div class="form_elem"&gt;
              &lt;label for="j_password" accesskey="l"&gt;Hasło:&lt;/label&gt; &lt;input
                  type="password" name="j_password"&gt;
          &lt;/div&gt;
          &lt;div class="form_elem"&gt;
              &lt;label for="_spring_security_remember_me"&gt;Zapamiętaj mnie?&lt;/label&gt; &lt;input
                  type='checkbox' name='_spring_security_remember_me'
                  id="_spring_security_remember_me" value="true" /&gt;
          &lt;/div&gt;
          &lt;input name="submit" type="submit" value="Send" class="newline" /&gt;
      &lt;/fieldset&gt;
      &lt;a href="register"&gt;Register&lt;/a&gt;&lt;br&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>you can notice the slash near <code>j_spring_security_check</code>, but before I didn't have this slash, and when someone refreshed after registration he got login page rendered but this link in the browser for example</p>
  
  <pre><code>localhost:8080/taboret/activateAccount/50555449564956495757565057535150535649494956565550554949565752545053505252485450
  </code></pre>
  
  <p>If now the login form was sent, it got sent to the <code>http://localhost:8080/taboret/activateAccount/j_spring_security_check</code></p>
  
  <p>but I was thinking that this servlet context would be just the <code>taboret</code>, the name of the application.</p>
  
  <p>What this <code>Prepending the name of the current servlet context</code> mean then?</p>