Hi,
I am trying to get local disk path of my webapp (at run time) that has
an EJB deployed in it. The EJB is a simple remote EJB annotated with the
@Remote annotation.
For a servlet we can get it by calling the
servletContext.getAbsolutePath(), but I was not able to find a way out
to do the same within an EJB since there is no handle to the
ServletContext/ServletConfig objects.
invoking getClass().ClassLoader.getResource() on a valid bundled file
didn't help either!
I have overridden the setSessionContext() method, but I don't think I
can pullout the absolute path starting from the SessionContext object.
Any suggestion for me?
TIA,
Ranjit
Arne Vajhøj - 19 May 2007 20:46 GMT
> I am trying to get local disk path of my webapp (at run time) that has
> an EJB deployed in it. The EJB is a simple remote EJB annotated with the
[quoted text clipped - 9 lines]
> I have overridden the setSessionContext() method, but I don't think I
> can pullout the absolute path starting from the SessionContext object.
Considering that the EJB spec says:
An enterprise bean must not use the java.io package to attempt to
access files and directories in the file system.
then there are not much need for the feature.
Arne