response.setContentType("text/plain");
PrintWriter writer = response.getWriter();
- String qryString= request.getQueryString();
if( mBeanServer==null ) {
writer.println("Error - No mbean server");
try {
ObjectName oname = new ObjectName(onameStr);
Object value = mBeanServer.getAttribute(oname, att);
- writer.println("OK - Attribute get '" + onameStr + "' - " + att + "= " + value.toString() );
+ writer.println("OK - Attribute get '" + onameStr + "' - " + att
+ + "= " + escape(value.toString()));
} catch (Exception ex) {
writer.println("Error - " + ex.toString());
}
int prev=0;
StringBuffer sb=new StringBuffer();
while( idx >= 0 ) {
- appendHead(sb, value, prev, idx-1);
+ appendHead(sb, value, prev, idx);
sb.append( "\\n\n ");
prev=idx+1;
}
private void appendHead( StringBuffer sb, String value, int start, int end) {
+ if (end < 1) return;
+
int pos=start;
while( end-pos > 78 ) {
sb.append( value.substring(pos, pos+78));
group="UserDatabase"
type="org.apache.catalina.users.MemoryUserDatabase">
- <attribute name="encoding"
- description="Character encoding to use when writing XML file"
- type="java.lang.String"/>
-
<attribute name="groups"
description="MBean Names of all defined groups"
type="[Ljava.lang.String;"
<subsection name="Webapps">
<changelog>
<fix>
- <bug>42459</bug>: Tomcat Web Application Manager table error (rjung)
+ <bug>39813</bug>: Correct handling of new line characters in JMX
+ attributes. Patch provided by R Bramley. Ported from tc5.5.x r415029. (markt,rjung)
+ </fix>
+ <fix>
+ <bug>42459</bug>: Fix Tomcat Web Application Manager table error. (rjung)
</fix>
<fix>
Fix XSS security vulnerabilities (CVE-2007-2449) in the examples.