accessing a resource from WEB-INF

Gareth Jones <[email protected]>
Newsgroups gmane.comp.java.sun.servlet
Message-ID <[email protected]>
Hi

I've got an app that uses an xml file which has been placed in the WEB-INF dir.

When I want to access it from a servlet or jsp I use the ServletContext().getResource method to return the resource and I can then parse it and manipulate it as required.

However I now want to access the same file from a Struts Validator class but I cant see any way to get the ServletContext.

I guess I could use this.getResource() in some way but I think that would place me in the package from which the class was loaded rather than the root of the app which is where I need to be.

Can anyone help?

thanks

----------
Send instant messages for free with MSN Messenger. Click here to download it now!

___________________________________________________________________________
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.