1

I want to echo application-context path after deployment on local tomcat. It might be done using maven or ant. All information I have is CATALINA_HOME variable. I tried using cargo plugin for maven, but it doesnt display context path after deployment, I also tried tomcat deploy plugin, but it requires me to specify tomcat manager path, as well as user and password.

Thank you in advance

user1387886
  • 122
  • 1
  • 7

1 Answers1

1

Implement a ServletContextListener and

final String contextPath = servletContextEvent.getServletContext().getContextPath();
System.out.println("context path = " + contextPath);
Community
  • 1
  • 1
jmj
  • 237,923
  • 42
  • 401
  • 438
  • Thank you for your answer. I cant check this out now. I need this context path to be displayed in shell where i called deploy command. Will this listener echo context path to shell or tomcat log? – user1387886 Dec 30 '14 at 07:39
  • if your deploy command waits till it deploys and streams the tomcat log back – jmj Dec 30 '14 at 07:40