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

  • Home
  • SEARCH
  • 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 7888107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:45:07+00:00 2026-06-03T05:45:07+00:00

I use spring-security to secure my web, when I’m learning it by spring-roo generated

  • 0

I use spring-security to secure my web, when I’m learning it by spring-roo generated config file in applicationContext-security.xml, in <http> node:

 <intercept-url pattern="/userses?form" access="hasRole('ROLE_ADMIN')" />

It means when you want to create a Users object, firstly you need to login to get ADMIN permission. But actually it didn’t work. Check the log:

2012-05-06 11:39:11,250 [http-8088-7] DEBUG org.springframework.security.web.util.AntPathRequestMatcher - Checking match of request : '/userses'; against '/userses?form'

The framework use the /userses instead of /userses?form to compare with, authentication process skipped as string didn’t match. To verify this I also try another url:

<intercept-url pattern="/userses/abc" access="hasRole('ROLE_ADMIN')" />

I requested the /userses/abc, it detected user is not authorized, and moved to /login page, checked the log:

2012-05-06 11:46:44,343 [http-8088-7] DEBUG org.springframework.security.web.util.AntPathRequestMatcher - Checking match of request : '/uesrses/abc'; against '/userses/abc'

So my question is: Doesn’t spring-secure 3 support “?parameter” pattern or I missed something to config to support this?
PS: All the code is generated by roo without modification, also wonder why it doesn’t work.

  • 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-03T05:45:08+00:00Added an answer on June 3, 2026 at 5:45 am

    By default spring security uses ant style matching, which can’t match on parameters. Regex matching, however, can match on parameters

    Try defining it like so:

    <http request-matcher="regex">
      <security:intercept-url pattern="\A/userses\?form.*\Z" access="hasRole('ROLE_ADMIN')" />
    </http>
    

    Don’t know why Roo doesn’t do this automatically. Seems like it should.

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

Sidebar

Related Questions

At my project I use Spring Security and GWT with url-like internationalization (http://....html?locale=en). Login
I'm developing a web application that use Spring Security for authentication of users. I
I'm trying to use the spring-security-core database request map config and it doesn't seem
I use Spring MVC (via Spring Roo) to build a small web application for
I use Spring Security 3 in my jsf2 web app. When a non-authenticated user
i want to use The Spring Security Facelets tag library to secure my UI
I am trying to use PreAuthFilter (for Siteminder) with Spring Security 3.0. <http use-expressions=true>
I'm trying to secure my Spring 3.1 web app with Spring Security 3.1, and
I am trying to use Spring Security 3.0.5 in my web application. Basically, I
How secure is Spring Security ? Is it good enough to use Spring Security

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.