title: Spring Security - showing logout message
body: <p>Spring security java based configuration is (it's not spring mvc, just servlet webapp)</p>
  
  <pre><code>    @Override
      protected void configure(HttpSecurity http) throws Exception {
          http
              .authorizeRequests()
                  .anyRequest().authenticated()
                  .and()
              .formLogin()
                  .loginPage("/login.jsp")
                  .permitAll();
      }
  </code></pre>
  
  <p>and login page is</p>
  
  <pre><code>&lt;form name='loginForm' action="" method='POST'&gt;
  
              &lt;c:if test="${param.logout != null}"&gt;
                  &lt;p&gt;You have been logged out.&lt;/p&gt;
              &lt;/c:if&gt;
  
              &lt;table&gt;
                  &lt;tr&gt;
                      &lt;td&gt;User:&lt;/td&gt;
                      &lt;td&gt;&lt;input type='text' name='username'&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;Password:&lt;/td&gt;
                      &lt;td&gt;&lt;input type='password' name='password' /&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td colspan='2'&gt;&lt;input name="submit" type="submit"
                          value="submit" /&gt;&lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/table&gt;
  
              &lt;input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" /&gt;
  
          &lt;/form&gt;
  </code></pre>
  
  <p>and there is other page with logout link, so logout action is <code>logout</code> (page 2)</p>
  
  <pre><code>&lt;form action="logout" method="post"&gt;
        &lt;input type="submit" value="Logout" /&gt;
        &lt;input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>After I succesfully loged in and then pressed logout button (from page 2) it returned my to the login page but the login page did not show the logout message <code>&lt;c:if test="${param.logout != null}"&gt;</code>. After that I try to log in again but it did not work (it is only login after logout) and showed me a logout message. Why it works that way and how to fix it to show logout message just after logout was pressed.</p>