Results 1 to 4 of 4

Thread: Legacy xml config file

  1. #1
    Join Date
    Jun 2005
    Posts
    13

    Default 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. #2
    Join Date
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,104

    Default

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

  3. #3
    Join Date
    Jun 2005
    Posts
    13

    Default

    Thanks for you answer.

    but how do I access servlet context?

  4. #4
    Join Date
    Oct 2004
    Location
    Herndon, VA, US
    Posts
    648

    Default

    You can subclass FrameworkServlet and override initFrameworkServlet() to do any legacy servlet init work.
    --Jing Xue

Similar Threads

  1. Replies: 2
    Last Post: Apr 12th, 2012, 09:34 AM
  2. Replies: 19
    Last Post: Sep 10th, 2007, 12:46 PM
  3. Saving large files to a db using hibernate?
    By Dan Washusen in forum Data
    Replies: 10
    Last Post: Sep 20th, 2006, 12:18 PM
  4. Replies: 2
    Last Post: May 2nd, 2005, 05:33 AM
  5. Replies: 8
    Last Post: Mar 3rd, 2005, 06:25 PM

Posting Permissions

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