I upgraded from Tomcat 6 to Tomcat 7 and the manager differs some. In Tomcat 6's manager I would get a confirmation box when trying to stop or undeploy an app but in Tomcat 7 it just happens.
My questions is, can I disable or at least attach a confirmation javascript to the undeploy button?
The short answer version is NO, because the html is within the java class hardcoded as you can see it here:
HTMLManagerServlet
But you can still do the following:
extends HTMLManagerServlet and override the following method
protected void list(HttpServletRequest request,
HttpServletResponse response,
String message,
StringManager smClient) throws IOException
to use a different variable instead of :
STARTED_DEPLOYED_APPS_ROW_BUTTON_SECTION, args));
and in YOUR_STARTED_DEPLOYED_APPS_ROW_BUTTON_SECTION variable you can inject your JS code that will handle the onclick event see this can be of help too:
Inline onclick JavaScript variable
Then you compile your YourHTMLManagerServlet and change the manager/WEB-INF/web.xml from:
<servlet>
<servlet-name>HTMLManager</servlet-name>
<servlet-class>org.apache.catalina.manager.HTMLManagerServlet</servlet-class>
<init-param>
to:
<servlet>
<servlet-name>HTMLManager</servlet-name>
<servlet-class>your.own.YourHTMLManagerServlet</servlet-class>
<init-param>
put the jar with the tomcat/lib directory and your ready to go.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With