You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Henri Dupre <he...@gmail.com> on 2005/05/11 21:03:37 UTC

Where to put version information in war file?

I was wondering what is the best place to put version information in a war file?
I'd like to put a build version and date at built time to my
application and have a way to retrieve them from the servlets.

I'm used to add the META-INF Implementation-version tag with jar files
but with Tomcat war files it doesn't work. Are there other
"standard" places where to put version information?

Henri.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Where to put version information in war file?

Posted by Wade Chandler <wa...@ddiofsc.com>.
Henri Dupre wrote:
> I was wondering what is the best place to put version information in a war file?
> I'd like to put a build version and date at built time to my
> application and have a way to retrieve them from the servlets.
> 
> I'm used to add the META-INF Implementation-version tag with jar files
> but with Tomcat war files it doesn't work. Are there other
> "standard" places where to put version information?
> 
> Henri.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 

context-param is easy to access.  You could put them in your web.xml 
file and access them from Servlets and JSPs.  I'm not sure if there are 
any best pratices for it.

Wade

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Where to put version information in war file?

Posted by Lionel Farbos <li...@free.fr>.
On Wed, 11 May 2005 15:03:37 -0400
Henri Dupre <he...@gmail.com> wrote:

> I was wondering what is the best place to put version information in a war file?
> I'd like to put a build version and date at built time to my
> application and have a way to retrieve them from the servlets.
> 
> I'm used to add the META-INF Implementation-version tag with jar files
> but with Tomcat war files it doesn't work. Are there other
> "standard" places where to put version information?
> 
> Henri.
> 
Hi,

I use this mecanism and it works.
I put version information in the META-INF/MANIFEST.MF of the war,
then thanks to getServletContext().getResource("/META-INF/MANIFEST.MF"), you can get this file and parse it.

Regards.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


classpath problem?

Posted by Bagus <ba...@cox.net>.
Hi,

Newbie here,

I'm not sure why I'd be getting these compilation errors. I see my tomcat
server at http://localhost/.

The http://www.coreservlets.com/Apache-Tomcat-Tutorial/ seems to tell me
it's my classpath, but *I* think I have my jar files properly in my
classpath. See this following shell transcript. Thanks,  Bagus


 > id
uid=0(root) gid=0(wheel) groups=0(wheel), 5(operator)

 > echo $CLASSPATH
.:/www/my_tomcat_apps:/usr/local/jakarta-tomcat-5.4.4/common/lib/servlet-api
.jar:/usr/local/jakarta-tomcat-5.5.4/common/lib/jsp-api.jar

 > ls /usr/local/jakarta-tomcat-5.5.4/common/lib/jsp-api.jar
/usr/local/jakarta-tomcat-5.5.4/common/lib/jsp-api.jar

 > ls /usr/local/jakarta-tomcat-5.5.4/common/lib/servlet-api.jar
/usr/local/jakarta-tomcat-5.5.4/common/lib/servlet-api.jar

 > pwd
/usr/www/my_tomcat_apps

 > ls -al HelloServlet.java
-rw-r--r--  1 bagus  staff  955 Feb 18 09:04 HelloServlet.java


 > javac HelloServlet.java
elloServlet.java:2: package javax.servlet does not exist
import javax.servlet.*;
^
HelloServlet.java:3: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
HelloServlet.java:13: cannot resolve symbol
symbol  : class HttpServlet
location: class HelloServlet
public class HelloServlet extends HttpServlet {
                                   ^
HelloServlet.java:14: cannot resolve symbol
symbol  : class HttpServletRequest
location: class HelloServlet
   public void doGet(HttpServletRequest request,
                     ^
HelloServlet.java:15: cannot resolve symbol
symbol  : class HttpServletResponse
location: class HelloServlet
                     HttpServletResponse response)
                     ^
HelloServlet.java:16: cannot resolve symbol
symbol  : class ServletException
location: class HelloServlet
       throws ServletException, IOException {
              ^
6 errors


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org