Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

jws file context

Status
Not open for further replies.

MoreFeo

Technical User
Nov 29, 2002
547
ES
Hi,

I'm trying to create a WebService (Weblogic Workshop 8.1) that needs to read some information from a file (path=/WEB-INF/config/policies.txt).
I need to use relative paths, not absolute paths, but I don't know how to make this.

In the Controller or in a servlet I would use
Code:
 getServletContext().getResourceAsStream(path)
or
Code:
 getServletContext().getRealPath("/")+path
to read this file, with an InputStream or a File, but in the jws I cannot use this.

Does anyone knows how can I do this?

Thanks
 
Well, managed to do it with

Thread.currentThread().getContextClassLoader().getResource(...)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top