users@glassfish.java.net

Re: How to use resource-env-ref in glassfish-application.xml ...

From: <forums_at_java.net>
Date: Tue, 20 Aug 2013 14:36:15 -0500 (CDT)

Well I've had time to look into this more and I figured out a solution. In
the application, use: @Resource(name =
"java:app/env/DownloadService/BasePath") String basePath; or String basePath
= (String) new
InitialContext().lookup("java:app/env/DownloadService/BasePath"); Nothing
goes in web.xml. In application.xml, put:
java:app/env/DownloadService/BasePath java.lang.String And finally, in
glassfish-application.xml, put the mapping to the container-specific jndi
lookup: java:app/env/DownloadService/BasePath TheRealJndiName

--
[Message sent by forum member 'stdarg']
View Post: http://forums.java.net/node/897942