title: cannot use spring security within url rewrite tucky
body: <p>I am using Spring mvc within url rewrite tucky to have extension less Urls. All is working fine but I recently have a problem to handle /j_spring_security_check post.
  here are my config files</p>
  
  <p>urlrewrite.xml
      </p>
  
  <p></p>
  
  <pre><code>&lt;rule&gt;
     &lt;from&gt;/$&lt;/from&gt;
     &lt;to type="forward"&gt;home&lt;/to&gt;
  &lt;/rule&gt;
  &lt;rule&gt;
     &lt;from&gt;/signup$&lt;/from&gt;
     &lt;to type="forward"&gt;/signup&lt;/to&gt;
  &lt;/rule&gt;
  &lt;rule&gt;
      &lt;from&gt;/j_spring_security_check(\?.*)&lt;/from&gt;
      &lt;to last="true"&gt;/j_spring_security_check$1&lt;/to&gt;
  &lt;/rule&gt; 
  &lt;rule&gt;
      &lt;from&gt;/logout(\?.*)&lt;/from&gt;
      &lt;to last="true"&gt;/logout$1&lt;/to&gt;
  &lt;/rule&gt; 
  &lt;rule&gt;
      &lt;from&gt;^([^?]*)/([^?/\.]+)(\?.*)?$&lt;/from&gt;
      &lt;to last="true"&gt;$1/$2.htm$3&lt;/to&gt;
  &lt;/rule&gt;
  &lt;outbound-rule&gt;
      &lt;from&gt;^(.*)\.htm(\?.*)?$&lt;/from&gt;
      &lt;to last="false"&gt;$1$2&lt;/to&gt;
  &lt;/outbound-rule&gt;
  </code></pre>
  
  <p></p>
  
  <p>spring security `
  </p>
  
  <pre><code>&lt;!-- This is where we configure Spring-Security --&gt;
  &lt;security:http auto-config="true" use-expressions="true" access-denied-page="/denied.htm"&gt;
      &lt;security:intercept-url pattern="/**"  access="permitAll" /&gt;
      &lt;security:intercept-url pattern="/admin/**"  access="hasRole('ROLE_ADMIN')" /&gt;
      &lt;security:intercept-url pattern="/user" access="hasRole('ROLE_USER')" /&gt;
      &lt;security:form-login login-page="/signup" authentication-failure-url="/signup?error=authenticate" default-target-url="/" /&gt;
      &lt;security:logout invalidate-session="true" logout-success-url="/" logout-url="/logout" /&gt;
      &lt;security:remember-me key="springRocks" user-service-ref="userDetailsService"/&gt;
  &lt;/security:http&gt;
  
  
  &lt;!-- Declare an authentication-manager to use a custom userDetailsService --&gt;
  &lt;security:authentication-manager&gt;
      &lt;security:authentication-provider user-service-ref="userDetailsService"&gt;
          &lt;security:password-encoder ref="passwordEncoder" /&gt;
      &lt;/security:authentication-provider&gt;
  &lt;/security:authentication-manager&gt;
  
  &lt;!-- Use a Md5 encoder since the user's passwords are stored as Md5 in the 
      database --&gt;
  &lt;bean
      class="org.springframework.security.authentication.encoding.Md5PasswordEncoder" id="passwordEncoder" /&gt;
  
  &lt;bean id="userDaoService" class="com.dolo.dao.jdbc.JdbcUserDao"&gt;
      &lt;property name="dataSource" ref="dataSource" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="userDetailsService" class="com.dolo.services.impl.UserServiceImpl"&gt;
  &lt;/bean&gt;
  
  &lt;bean id="userDetails" class="com.dolo.model.User"&gt;
  &lt;/bean&gt; 
  </code></pre>
  
  <p>`</p>
  
  <p>web.xml</p>
  
  <pre><code>      &lt;servlet&gt;
  &lt;servlet-name&gt;dolo&lt;/servlet-name&gt;
  &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
  &lt;init-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;
          &lt;/param-value&gt;
      &lt;/init-param&gt;
  &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  </code></pre>
  
  <p></p>
  
  <p>...</p>
  
  <pre><code>&lt;servlet-mapping&gt;
  &lt;servlet-name&gt;dolo&lt;/servlet-name&gt;
  &lt;url-pattern&gt;*.htm&lt;/url-pattern&gt;
  </code></pre>
  
  <p></p>
  
  <p>...</p>
  
  <pre><code>&lt;filter&gt;
      &lt;filter-name&gt;UrlRewriteFilter&lt;/filter-name&gt;
      &lt;filter-class&gt;org.tuckey.web.filters.urlrewrite.UrlRewriteFilter&lt;/filter-class&gt;
  &lt;/filter&gt;
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;UrlRewriteFilter&lt;/filter-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;dispatcher&gt;REQUEST&lt;/dispatcher&gt;
      &lt;dispatcher&gt;FORWARD&lt;/dispatcher&gt;
  &lt;/filter-mapping&gt;
  </code></pre>
  
  <p></p>
  
  <p>....</p>
  
  <pre><code>  &lt;filter&gt;
  &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
  &lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;/filter-class&gt;
  </code></pre>
  
  <p></p>
  
  <p>....</p>
  
  <pre><code>  &lt;filter-mapping&gt;
  &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
  &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;dispatcher&gt;REQUEST&lt;/dispatcher&gt;
  &lt;dispatcher&gt;FORWARD&lt;/dispatcher&gt;
  &lt;dispatcher&gt;INCLUDE&lt;/dispatcher&gt;
  &lt;dispatcher&gt;ERROR&lt;/dispatcher&gt;
  </code></pre>
  
  <p></p>