In Railo 3.3.1, I'm getting empty string for
server.coldfusion.rootdir. Is this intentional, or a bug? It's clearly
a difference from ACF.
Re my actual use case, I'm looking for a way to uniquely distinguish
the CFML engine instance running my code on from others on the same
server. Ideally this would be a technique that's usable on ACF, Railo,
and Open BlueDragon. This is in environments that may have multiple CF
instances, potentially running on different CFML engines.
Starting my investigation from ACF, I thought
server.coldfusion.rootdir could do it, but hit the above empty string
behavior on Railo.
Thanks for any thoughts,
Dave
Dave
I want a way to "fingerprint" each running instance, to tell it apart
from other running instances, regardless of what engine they're using,
even when there may be multiple instances of the same engine.
For example, my laptop has one instance each of latest Railo, latest
BD, and ACF 8, plus three instances of ACF 9, and I need to be able to
tell each of those apart in code.
Make sense?
Dave
Still curious about my original question though.
Dave
If you've got control of the startup, you can set a system property when
starting the engine and tell that way. I do something like this with
JBoss clusters to determine which node it's on, etc..
Or you could try something like expandPath("/") to see what the root dir
is. Or maybe drop to java and to a getResource() on something...
Obviously the most accurate is the explicit one (setting a property on
startup), but you may not have that control.
:Denny
--
Railo Technologies: getrailo.com Professional Open Source
Skype: valliantster (505)510.1336 de...@getrailo.com
GnuPG-FP: DDEB 16E1 EF43 DCFD 0AEE 5CD0 964B B7B0 1C22 CB62
This is a "guest" package, designed to run under any app, that lets
you view and manipulate dbs and files, plus evaluate or run code you
type into it. Very very handy for debugging remotely.
Looks like ExpandPath('/') may win here; see my msg above. Still
wondering what's up w the blank rootdir though.
Dave
Most the time it would probably work, but...
I'd lean towards a getPageContext() type of deal probably.
getPageContext().getServletConfig() maybe? Something like that, which
is tied to the servlet vs. a potentially incorrect file system path.
As for the rootdir, it sounds like it's a valid ticket. File away! :)
String rootdir= pc.getConfig().getRootDirectory().getAbsolutePath();
And get the web context web root, but Micha would know for sure.
:Denny
Greetings from Switzerland
Gert Franz
Railo Technologies Professional Open Source
skype: gert.franz ge...@getrailo.com
+41 76 5680 231 www.getrailo.com
-----Ursprüngliche Nachricht-----
Von: ra...@googlegroups.com [mailto:ra...@googlegroups.com] Im Auftrag von
Denny
Gesendet: Donnerstag, 13. Oktober 2011 06:13
An: ra...@googlegroups.com
Betreff: Re: [railo] server.coldfusion.rootdir
However, thinking through my specific use case, it turns out that I
don't actually need to tell engine instances apart, only the root
directories they serve from. Given that, ExpandPath('/') is probably
better in the cluster case.
Dave