Hi!
I ran into a problem trying to set application context version
<http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Parallel_deployment> using manager-script
<http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html#Configuring_Manager_Application_Access> "tools-friendly
plain text" requests in Tomcat 7.0.29. The deploy section
<http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html#Deploy_A_New_Application_Remotely> states that the tag
attribute could behave the same way as using the /app_context/##/context_version/.war pattern in uploaded war-s:
"
* |tag|: Specifying a tag name, this allows associating the deployed webapp
with a *version number*. The application
version can be later redeployed when needed using only the tag.
"
After deploying the app using wget, context version is not available. So I peeked into ManagerServlet source and this
is what I saw:
org.apache.catalina.manager.ManagerServlet
<eclipse-javadoc:%E2%98%82=Tomcat%207.0.30/%3Corg.apache.catalina.manager%7BManagerServlet.java%E2%98%83ManagerServlet>#doGet
..
if (command == null)
command = request.getServletPath();
String config = request.getParameter("config");
String path = request.getParameter("path");
ContextName cn = null;
if (path != null) {
cn = new ContextName(path, request.getParameter("*version*"));
}
String type = request.getParameter("type");
String war = request.getParameter("war");
String tag = request.getParameter("*tag*");
...
// Process the requested command (note - "/deploy" is not listed here)
if (command == null) {
writer.println(smClient.getString("managerServlet.noCommand"));
} else if (command.equals("*/deploy*")) {
if (war != null || config != null) {
deploy(writer, config, *cn*, war, update, smClient);
} else {
deploy(writer, *cn*, *tag, *smClient);
}
} else if (command.equals("/list")) {
...
This reveals an undocumented attribute "version", which instead of "tag" is used to get context version. I suggest
someone fixes current manager-howto documentation, hopefully it saves some time :)
--
*Tanel Käär*
Senior developer
tanel.k...@nortal.com <mailto:tanel.k...@nortal.com> | +372 56790907
<tel:+37256790907> | Skype: sntina <skype:sntina>
*Nortal AS* | www.nortal.com <http://www.nortal.com/> | Raatuse 20, Tartu
51009, Estonia