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 7854823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:11:57+00:00 2026-06-02T20:11:57+00:00

<security:intercept-url pattern=/person/** access=isAuthenticated() /> <security:intercept-url pattern=/person?reg access=isAnonymous() /> I want for filter to intercept

  • 0
    <security:intercept-url pattern="/person/**" 
        access="isAuthenticated()" />   


    <security:intercept-url pattern="/person?reg"
        access="isAnonymous()" />

I want for filter to intercept all of the requests that are /person/blabla etc.
But there should be a single one available to anonymous users to register themself.

Whenever I introduce the first rule all sub requests are protected including the bottom one which is not what is required.

If I don’t introduce first then the bottom request is allowed, but also all subsequent requests such as /person/myProfile can be accessed by anonymous user.

  • 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-02T20:11:59+00:00Added an answer on June 2, 2026 at 8:11 pm

    From the Spring Security docs:

    You can use multiple elements to define different access requirements for different sets of URLs, but they will be evaluated in the order listed and the first match will be used. So you must put the most specific matches at the top.

    Also, spring uses ant-style pattern matching by default, which doesn’t include the parameters when trying to make a match. You’re wanting to also match on whether or not a parameter exists. In order to do that, you’re going to need to set regex matching via the request-matcher attribute on http.

    <http request-matcher="regex">
      <security:intercept-url pattern="\A/person\?reg.*\Z" access="isAnonymous()" />
    
      <security:intercept-url pattern="\A/person/.*\Z" access="isAuthenticated()" />
    </http>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following spring security configuration: <security:http> ...... <security:intercept-url pattern=/auth/** access=ROLE_ADMIN/> ......... </security:http>
I have the following Spring security configuration: <security:http> <security:intercept-url pattern=/** access=ROLE_USER/> <security:intercept-url pattern=/auth/** access=ROLE_ADMIN/>
I have a web application that uses spring security. It uses <intercept-url ../> elements
How can I programmatically access the contents of the intercept-url declarations (from the http://www.springframework.org/schema/security
what is the difference between a Spring Security intercept-url pattern with path/** or path/*
I have my configuration of intercept url like <security:http use-expressions=true disable-url-rewriting=true> <security:intercept-url pattern=/secure/admission/* access=hasRole('ROLE_ADMISSIONER')
my web.xml config is <filter> <filter-name>springSecurityFilterChain</filter-name> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> </filter> <filter-mapping> <filter-name>springSecurityFilterChain</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> here is
I searched for the answer, but didn't find it. If I add <intercept-url pattern=/test*
HI, How can i change internet explorer security settings by code. i want to
The security policy at our client's production environment requires that we use separate connection

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.