Archive: Tomcat question - I'm being lame and useless


Tomcat question - I'm being lame and useless
Hi, lame and useless Rob here

Sorry to bother you folks but there are some bright cookies amongst you and I need someone who can tell me this:

In my installer I need to detect the Apache Tomcat version. There is no regular way to do this as the method changes between versions (clever huh) but apparently the ServletContext#getServerInfo() command (thing) works.

I'm not sure where to put this or what to do with it. I know this is slightly off-topic but it is regarding my NSIS installer and I'm at the end of my tether regarding it!

Thanks for reading guys

Rob


Why dont you use registry keys dood.Try using the same coding as you would to get the windows version, but just read in difforent registry keys.


Honestly uh mate I've tried. The key locations change across versions. And even change within the same version number. And even if this weren't enough, there might be older keys hanging around from previous installs.

Ta for reply tho :)


From Tomcat FAQ:

http://jakarta.apache.org/tomcat/faq/misc.html#version

You were almost there ;)


Aha! That's the little wotsit. Yeah, I'm not sure how to proceed with it, i.e. how to write a Java app which will hook into it (and even if I do this, will tomcat have to be running already for it to be detected?).


You can take a look inside this version.bat and imitate it or you can simply include the batch file itself and execute it as is.