tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: Tomcat HeapMemoryUsage MBean question
Date Fri, 07 Sep 2012 21:50:38 GMT
2012/9/8 Shanti Suresh <shanti@umich.edu>:
> Hi Konstantin,
>
> True.  JMX data can be sensitive.
>
> I am not a JSP expert.  I created the following "test.jsp" page and have it
> sitting in webapps/manager/.  It doesn't work.  I have the error message
> below the JSP text.  Would you have a suggestion for what I might have in
> this page?
>

1) All HTML text around is unnecessary.
It will be thrown away when forward is performed.

> <jsp:forward page="/jmxproxy/">
> <jsp:param name="get" value="java.lang%3Atype%3DMemory" />

2) You do not need to url-encode the parameter value. Those %3A and
%3D are actually ":" and "=".

> <jsp:param name="att" value="HeapMemoryUsage" />
> <jsp:param name="key" value="used" />
> </jsp:forward>

The following works for me:
1. In web.xml in configuration for CsrfPreventionFilter, add the
following to the value of "entryPoints" parameter:
[[[
,/test.jsp
]]]

2. The following is test.jsp
[[[
<%@page session="false"%>
<jsp:forward page="/jmxproxy/">
<jsp:param name="get" value="java.lang:type=Memory" />
<jsp:param name="att" value="HeapMemoryUsage" />
<jsp:param name="key" value="used" />
</jsp:forward>
]]]

If I navigate to
http://localhost:8080/manager/test.jsp
it displays
OK - Attribute get 'java.lang:type=Memory' - HeapMemoryUsage - key
'used' = 9081352

By default this new page is not secured, so it does not ask for password.

Best regards,
Konstantin Kolinko

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


Mime
View raw message