I'm pretty sure that it is.  From your Session-Bean try this:

InputStream is =
this.getClass().getClassLoader().getResourceAsStream("the-relative-path-and-
filename");

or this:

InputStream is =
this.getClass().getClassLoader().getSystemResourceAsStream("the-relative-pat
h-and-filename");

I haven't done this specifically with beans yet, but from my experience with
other java objects this should do the trick.

Hope that helps,
Ken

----- Original Message -----
From: "Stefano Andreani" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, July 08, 2000 11:55 AM
Subject: Accessing resource files from an EJB


> Is it possible to access from a Session Bean to resource files bundled
into
> its EJB Jar archive? I need to read some property files, but I want to use
> only relative paths (the paths of the resources inside the jar archive),
so
> that I needn't to change nothing when deploying into different J2EE
servers.
>
> Thanks,
> Stefano.
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to