This content has been marked as final.
Show 3 replies
-
1. Re: How to change physical deployment filepath?
nickarls May 31, 2016 4:11 AM (in response to adamvainder)Without testing, does
@Resource
(lookup=
"java:app/AppName"
)
private
String appName;
give anything reasonable? (perhaps some other stuff in JNDI?)
-
2. Re: How to change physical deployment filepath?
adamvainder May 31, 2016 1:20 PM (in response to nickarls)Hi Nicklas,
No luck with JNDI it did lead me to using the initial context to look up the app name.
String aname = (String) initialContext.lookup("java:app/AppName"); //EAR, returns ABCD
String mname = (String) initialContext.lookup("java:module/ModuleName"); //WAR, returns XYZ
It's not ideal, but it works for the moment.
Thank you.
Edit: Had my lookups backward the first time
-
3. Re: How to change physical deployment filepath?
nickarls May 31, 2016 2:42 PM (in response to adamvainder)Yep, forgot to say that resource injection only works for managed beans but it's essentially the same thing you did manually.