Results 1 to 3 of 3

Thread: Handle multiple spring security context files based on property file's value

  1. #1
    Join Date
    Apr 2012
    Posts
    1

    Unhappy Handle multiple spring security context files based on property file's value

    Hello everyone,
    I'm having problem with handling multiple security context files. Let me describe what I'm trying to do:

    I have my existing application which is running perfectly with my current spring security configuration. I'm trying to introduce another security mechanism that handle application security in different way. But I want to keep our existing security config as a backup and want to handle which one to use from a property file.

    Say I have two spring security context files:

    applicationContext-security.xml applicationContext-security-new.xml

    And I have a property something like this: spring.config.use.new.config=true

    So if the property file is true it will use the new context file. If something goes wrong I will just change the property file and can use existing security mechanism.

    Is that possible? Any information will be highly appreciated. Looking forward for anyone's answer

    Thanks in advance.

  2. #2
    Join Date
    Apr 2012
    Posts
    9

    Default

    I will suggest that do not use property file approach.
    You can simply do it by keeping both file and use only one name like applicationContext-security.xml (lets it is new security file)
    and old file keep as applicationContext-security.xml_bak. And if new file does not work change the name. make the new as as bak.

  3. #3
    Join Date
    Jan 2008
    Posts
    1,826

    Default

    You can do this in Spring 3.1 using Spring Profiles
    Rob Winch - @rob_winch
    Spring Security Lead
    Pivotal

Tags for this Thread

Posting Permissions

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