Announcement Announcement Module
Collapse
No announcement yet.
Handle multiple spring security context files based on property file's value Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment


    • #3
      You can do this in Spring 3.1 using Spring Profiles

      Comment

      Working...
      X