Re: Getting a resource from a WAR

2004-10-24 Thread Eddie Bush
se it "just feels wrong". Regards, Eddie - Original Message - From: "Dinesh Sampangi" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, October 25, 2004 1:40 AM Subject: Re:

Re: Getting a resource from a WAR

2004-10-24 Thread Dinesh Sampangi
Hi! try putting the "myresource.xml" under /WEB-INF/classes/ and get access to it as below. public void init() throws ServletException { try{ SAXBuilder builder = new SAXBuilder(); URL confFileURL = this.getServletContext().getResource("/WEB-INF/classes/MyResource.xml"); logger.info(

Re: Getting a resource from a WAR

2004-10-21 Thread Jeff Beal
Try getResource("/WEB-INF/myresource.xml"); -- Jeff kjc wrote: I have an ActionServlet that subclasses the struts action servlet. In my init() method i'm trying to load a resource like this. public void init(){ URL url = this.getServletContext().getResource("/myresource.xml");

Getting a resource from a WAR

2004-10-21 Thread kjc
I have an ActionServlet that subclasses the struts action servlet. In my init() method i'm trying to load a resource like this. public void init(){ URL url = this.getServletContext().getResource("/myresource.xml"); logger.info("the config resource was " + (url != null ? "fo