File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Websphere and the fly likes Reading ear from JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Reading ear from JSP" Watch "Reading ear from JSP" New topic

Reading ear from JSP

K Thapa

Joined: Sep 02, 2004
Posts: 8
Hello all,

In order to display application ear version,I need to access ear-specific file from my jsp.
When I do:
it gives me the war specific expected) .
Changin it to application.getResourceAsStream("../META-INF/") returns null.

I also tried few other things like but they all return null:
1. ClassLoader.getSystemClassLoader().getResourceAsStream(" META-INF/")
2.this.getClass().getClassLoader().getParent().getResourceAsStream(" META-INF/")
Here is my structure
- META-INF ( has and application.xml)

- xyz.war ( has readmanifest.jsp/WEB-INF/ META-INF-> )
readmanifest.jsp should read one level up.

How do I get hold of the ear-level( app level) Classloader in Websphere?
Is there an alternate way to achieve what I am trying to do?

Thanks in advance.

[ November 21, 2007: Message edited by: K Thapa ]
[ November 21, 2007: Message edited by: K Thapa ]
Maciej Miklas
Ranch Hand

Joined: Feb 12, 2007
Posts: 61
Do you have solution for your problem?
K Thapa

Joined: Sep 02, 2004
Posts: 8
Use basic java I/O. Something like:
I agree. Here's the link:
subject: Reading ear from JSP
jQuery in Action, 3rd edition