Announcement Announcement Module
Collapse
No announcement yet.
Configuring the Test and Production Enviroment Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Configuring the Test and Production Enviroment

    Hello,
    I have the following requirement
    I want the ApplicationContext to be loaded in two modes
    1. When the Web Server is starting up for which I have made an entry of the xml files in web.xml

    2. I also want the Spring Application.xml to Load from stand alone Java application ?

    How do I use the a separte file to specify the WEB.xml files and Load ApplicationContext Loader in two different modes?


    Regards
    Kailasoh

  • #2
    I don't fully understand your question but I'll try to reply. If you want to load the same application context then simply for the web app use ContextLoaderListener/Servlet while for the second case expose the xml context file (so it can be remotely read).
    As you are using a web application, you could make the xml public (just as you would do with an html page) at a predefined location (you can also use some simple security to restrict access).

    Comment


    • #3
      Hi,
      Sorry for the unclear post.
      This is exactly what is happening

      I have following spring configuration XML files
      1. gics-servlet.xml --- List of Controllers and view Resolvers
      2. gics-data.xml,gics-cache.xml -- List of all Business Logic and Data
      access beans

      And there is cross refrence from gics-servlet.xml to gics-data.xml,gics-
      cache.xml

      If I declare all the beans in web.xml contextconfigparameter everything works fine

      But when I separate out other file to applicationContext.xml and keeps gics-servlet.xml in web.xml as follows:

      <context-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>WEB-INF/applicationContext.xml WEB-INF/gics-
      servlet.xml</param-value>
      </context-param>

      then while starting the app server it says "could not find the bean companyAdapter"
      where company adapter is a bean defined in gics-data.xml inside applicationContext.xml and used by gics-servlet.xml

      Is there a problem in which I am declaring my XML's ??
      I know when I use import in gics-servlet everything works fine
      but somehow I donot feel its the right solution
      Regds
      Kailash

      Comment

      Working...
      X