title: how to do logout in spring security
body: <p>I got the error when I click logout link in jsp. I am using spring security.</p>
  
  <p>The exception is: </p>
  
  <pre><code>Jan 6, 2012 9:30:45 AM org.apache.catalina.core.StandardWrapperValve invoke
  SEVERE: Servlet.service() for servlet [appServlet] in context with path [/billingEngine] threw exception
  java.lang.NullPointerException
      at java.util.Hashtable.get(Unknown Source)
      at org.apache.tomcat.util.http.Parameters.getParameterValues(Parameters.java:116)
      at org.apache.tomcat.util.http.Parameters.getParameter(Parameters.java:127)
      at org.apache.catalina.connector.Request.getParameter(Request.java:1133)
      at org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:384)
      at javax.servlet.ServletRequestWrapper.getParameter(ServletRequestWrapper.java:140)
      at org.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandler.determineTargetUrl(AbstractAuthenticationTargetUrlRequestHandler.java:86)
      at org.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandler.handle(AbstractAuthenticationTargetUrlRequestHandler.java:67)
      at org.springframework.security.web.authentication.logout.SimpleUrlLogoutSuccessHandler.onLogoutSuccess(SimpleUrlLogoutSuccessHandler.java:28)
      at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:100)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
  </code></pre>
  
  <p>The spring security .xml file is</p>
  
  <pre><code>&lt;http auto-config="false" entry-point-ref="authenticationEntryPoint"
      use-expressions="true"&gt;
      &lt;custom-filter ref="authenticationFilter" position="FORM_LOGIN_FILTER" /&gt;
      &lt;intercept-url access="hasRole('ROLE_ADMIN')" pattern="/common/admin/**" /&gt;
      &lt;intercept-url pattern="/common/accounting/**" access="hasRole('ROLE_USER')" /&gt;
      &lt;intercept-url pattern="/common/billing/**" access="hasRole('ROLE_COMPANY')" /&gt;
      &lt;logout logout-success-url="/login"/&gt;
  &lt;/http&gt;
  </code></pre>
  
  <p>How to solve it out?</p>
  
  <p>Thanks</p>