Hi,
You can do something like this:
First create an environment entry in your ejb-jar.xml file like:
<env-entry>
<env-entry-name>ConfigFile</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>/config/ConfigFile.xml</env-entry-value>
</env-entry>
private String getResourceNameFromEnvironment(String anEnvResourceName) throws
NamingException{
String theResourceName;
InitialContext theInitialContext = new InitialContext();
theResourceName = (String)theInitialContext.lookup("java:comp/env/" +
anEvironmentName);
return theResourceName;
}
private void loadResource(String aEnvResourceName){
String theResourceName = getResourceNameFromEnvironment(aEnvResourceName);
java.io.InputStream theInputStream =
getClass().getResourceAsStream(theResourceName);
}
Cheers
Lorenzo
SurfKitchen Inc.
[EMAIL PROTECTED] wrote:
> Hi to all!
> I�m almost a newbye to JBoss (and even to J2EE development). I have some issues to
>be covered in the project we are developing, many of them aim to be solved with
>having access to a repository and "read" data from there.
>
> Since we don�t want to use the database for that and we cannot access regular files
>from a EJB according to the J2EE specs, I need to know if it�s possible to deploy a
>kind of "resource" file wich can hold my data and access it trought the context or
>something like that.
>
> If this is possible.... What�s the how to? Where can I find documentation about it?
>Any alternative?
>
> Thanks a lot!!
> Jorge Suarez
> Commexnet Co.
> Medellin, Colombia
>
> ------------------------------------------------------------------------------
>
> Obt�n gratis tu cuenta de correo en StarMedia Email.
> �Reg�strate hoy mismo!. http://www.starmedia.com/email
>
> ------------------------------------------------------------------------------
>
>
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
>
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user