Announcement Announcement Module
Collapse
No announcement yet.
Legacy xml config file Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Legacy xml config file

    I have a legacy code I am using which requires initiation which is usually done in Servlet init method.

    Code:
    java.io.InputStream stream =
    			getServletContext().getResourceAsStream(
    				"web-inf/conf/Profile.xml");
    
    ProfileImpl.getProfile(stream);
    getProfile method reads the config file and stores the values in the static variable. The idea is that this is done only once
    What is the best way to call this code when using Spring?

  • #2
    If this is a bean you can use the init-method attribute. See the spring-beans.dtd.

    Comment


    • #3
      Thanks for you answer.

      but how do I access servlet context?

      Comment


      • #4
        You can subclass FrameworkServlet and override initFrameworkServlet() to do any legacy servlet init work.

        Comment

        Working...
        X