Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7849139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:26:21+00:00 2026-06-02T18:26:21+00:00

I am using Spring mvc within url rewrite tucky to have extension less Urls.

  • 0

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

urlrewrite.xml

<rule>
   <from>/$</from>
   <to type="forward">home</to>
</rule>
<rule>
   <from>/signup$</from>
   <to type="forward">/signup</to>
</rule>
<rule>
    <from>/j_spring_security_check(\?.*)</from>
    <to last="true">/j_spring_security_check$1</to>
</rule> 
<rule>
    <from>/logout(\?.*)</from>
    <to last="true">/logout$1</to>
</rule> 
<rule>
    <from>^([^?]*)/([^?/\.]+)(\?.*)?$</from>
    <to last="true">$1/$2.htm$3</to>
</rule>
<outbound-rule>
    <from>^(.*)\.htm(\?.*)?$</from>
    <to last="false">$1$2</to>
</outbound-rule>

spring security `

<!-- This is where we configure Spring-Security -->
<security:http auto-config="true" use-expressions="true" access-denied-page="/denied.htm">
    <security:intercept-url pattern="/**"  access="permitAll" />
    <security:intercept-url pattern="/admin/**"  access="hasRole('ROLE_ADMIN')" />
    <security:intercept-url pattern="/user" access="hasRole('ROLE_USER')" />
    <security:form-login login-page="/signup" authentication-failure-url="/signup?error=authenticate" default-target-url="/" />
    <security:logout invalidate-session="true" logout-success-url="/" logout-url="/logout" />
    <security:remember-me key="springRocks" user-service-ref="userDetailsService"/>
</security:http>


<!-- Declare an authentication-manager to use a custom userDetailsService -->
<security:authentication-manager>
    <security:authentication-provider user-service-ref="userDetailsService">
        <security:password-encoder ref="passwordEncoder" />
    </security:authentication-provider>
</security:authentication-manager>

<!-- Use a Md5 encoder since the user's passwords are stored as Md5 in the 
    database -->
<bean
    class="org.springframework.security.authentication.encoding.Md5PasswordEncoder" id="passwordEncoder" />

<bean id="userDaoService" class="com.dolo.dao.jdbc.JdbcUserDao">
    <property name="dataSource" ref="dataSource" />
</bean>

<bean id="userDetailsService" class="com.dolo.services.impl.UserServiceImpl">
</bean>

<bean id="userDetails" class="com.dolo.model.User">
</bean> 

`

web.xml

      <servlet>
<servlet-name>dolo</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
        </param-value>
    </init-param>
<load-on-startup>1</load-on-startup>

…

<servlet-mapping>
<servlet-name>dolo</servlet-name>
<url-pattern>*.htm</url-pattern>

…

<filter>
    <filter-name>UrlRewriteFilter</filter-name>
    <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
</filter>
<filter-mapping>
    <filter-name>UrlRewriteFilter</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
</filter-mapping>

….

  <filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>

….

  <filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>ERROR</dispatcher>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T18:26:22+00:00Added an answer on June 2, 2026 at 6:26 pm

    Both can work together without any problem

    <filter-mapping> declaration for springSecurityFilterChain should be done before UrlRewriteFilter one. Once that is done, you don’t need any rewrite rule for j_spring_security_check.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using spring MVC, and I have a custom authentication/security system that I had
i am creating a demo application using spring mvc 3.0.I have to apply the
I am using spring 3 mvc/security frameworks. I have created a Controller class that
I'm using Spring MVC with Freemarker as view technologie. I have a TemplateDirectiveModel object
I'm using Spring MVC 3.0 and Tomcat. I have a bean that has a
I'm trying to add a URL parameter within a Spring MVC application. It's a
I am using Spring MVC within Tomcat and what I thought was a standard
I am working on a Spring MVC application in which I have recently been
I'm using Spring MVC and jquery autocomplete, my spring controller looks like this @RequestMapping(value
I'm using Spring's form tag library in a Spring MVC application that I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.