0

I want to laod the spring context file based on the command line. Basically I am going to get the region from the command line and instanciate the beans in the context file based on region. Is there a way to pass the command line param to FileSystemXmlApplicationContext without maintaining 2 different context files?

Thanks in advance.

1 Answer 1

1

Yes, it depends on where exactly you want to load it:

  • use <import resource="${command.line.param}/context.xml" /> in your common applicationContext.xml
  • use <param-value>${command.line.param}/applicationContext.xml</param-value> in your web.xml, in a context-param named contextConfigLocation
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.