Results 1 to 3 of 3

Thread: FilterSecurityInterceptor & Regular Expression

  1. #1
    Join Date
    Aug 2004
    Location
    Roselle Park, NJ
    Posts
    167

    Default FilterSecurityInterceptor & Regular Expression

    I tried searching for an answer to this but I can't seem to locate one.

    I'm struggling with the RE for protecting URLS.

    I need to protect a file such as test.html but also test.html?queryString=fdsfjsdklf

    I tried something like \A/addemployee.html.*\Z=ROLE_ADMIN but that didn't seem to have any affect. (it worked for addemployee.html? but not addemployee.html?a) What is the correct syntax?

    Thanks
    -Scott

  2. #2
    Join Date
    Oct 2004
    Posts
    207

    Default

    \A/addemployee.html\Z=ROLE_ADMIN
    The query string is not part of the evaluation.

    I'd recommend using the Ant-style paths though, much less \A\Z stuff...

    Just have to add PATTERN_TYPE_APACHE_ANT and change the patterns

    <property name="objectDefinitionSource">
    <value>
    CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
    PATTERN_TYPE_APACHE_ANT
    /addemployee.html=ROLE_ADMIN
    /secure/**=ROLE_ADMIN
    </value>
    </property>

    -Ray

  3. #3
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    Also don't forget to express your most specific pattern first, and have the general patterns at the bottom of the objectDefinitionSource declaration. Debug-level logging also gives a lot of clues as to which pattern the FilterInvocationDefinitionSource is matching.

Similar Threads

  1. Replies: 0
    Last Post: Oct 6th, 2005, 03:41 PM
  2. Replies: 0
    Last Post: Jul 19th, 2005, 02:31 AM
  3. Spring + Hibernate ORA-00936: missing expression
    By Hugh_la_Main in forum Data
    Replies: 1
    Last Post: Jun 28th, 2005, 08:48 AM
  4. Simple Regular expression problem
    By schuer in forum AOP
    Replies: 3
    Last Post: Feb 22nd, 2005, 03:35 AM
  5. Replies: 2
    Last Post: Jan 24th, 2005, 09:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •