tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <Chuck.Caldar...@unisys.com>
Subject RE: parallel deployment question
Date Fri, 22 Nov 2013 22:07:01 GMT
> From: Leo Donahue - OETX [mailto:LeoDonahue@mail.maricopa.gov] 
> Subject: parallel deployment question

> When I parallel deploy demo##001.war, in my servlet, when I use:  
> servletContext.getContextPath();  it prints:  /demo

> Why doesn't it print /demo##001 ?

Because the context path is the same for all versions - that's the whole point.  If the context
path were different, the *client* would have to know that to reach the new version.

> If I do:  servletContext.getRealPath(getServletName());  it prints:  
> C:\ApacheTomcat\apache-tomcat-7.0.42\webapps\demo##001\servlet-mapping-name

The getRealPath() API is an abomination and should never be used.  Some servlet deployments
are on platforms without file systems, which is why it's allowed to return null.

> I wanted to grab the demo##001 name and stick in the corner of my web 
> apps running in development, so users can see which version is deployed.

Your webapp should have a build or version number included as part of your build mechanism.
 That number should not be associated with the deployment mechanism.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus
for use only by the intended recipient. If you received this in error, please contact the
sender and delete the e-mail and its attachments from all computers.


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


Mime
View raw message