package org.apache.catalina.ant;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+
import org.apache.tools.ant.BuildException;
("Must specify 'bean' and 'attribute' attributes");
}
log("Getting attribute " + attribute +
- " in bean " + bean );
- execute("/jmxproxy/?get=" + bean
- + "&att=" + attribute );
+ " in bean " + bean );
+ try {
+ execute("/jmxproxy/?get=" + URLEncoder.encode(bean, getCharset())
+ + "&att=" + URLEncoder.encode(attribute, getCharset()));
+ } catch (UnsupportedEncodingException e) {
+ throw new BuildException
+ ("Invalid 'charset' attribute: " + getCharset());
+ }
}
}
package org.apache.catalina.ant;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+
import org.apache.tools.ant.BuildException;
@Override
public void execute() throws BuildException {
super.execute();
- String queryString = (query == null) ? "":("?qry="+query);
+ String queryString;
+ if (query == null) {
+ queryString = "";
+ } else {
+ try {
+ queryString = "?qry=" + URLEncoder.encode(query, getCharset());
+ } catch (UnsupportedEncodingException e) {
+ throw new BuildException
+ ("Invalid 'charset' attribute: " + getCharset());
+ }
+ }
log("Query string is " + queryString);
execute ("/jmxproxy/" + queryString);
}
package org.apache.catalina.ant;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+
import org.apache.tools.ant.BuildException;
log("Setting attribute " + attribute +
" in bean " + bean +
" to " + value);
- execute("/jmxproxy/?set=" + bean
- + "&att=" + attribute
- + "&val=" + value);
+ try {
+ execute("/jmxproxy/?set=" + URLEncoder.encode(bean, getCharset())
+ + "&att=" + URLEncoder.encode(attribute, getCharset())
+ + "&val=" + URLEncoder.encode(value, getCharset()));
+ } catch (UnsupportedEncodingException e) {
+ throw new BuildException
+ ("Invalid 'charset' attribute: " + getCharset());
+ }
}
}
package org.apache.catalina.ant;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+
import org.apache.tools.ant.BuildException;
super.execute();
if (type != null) {
- execute("/resources?type=" + type);
+ try {
+ execute("/resources?type=" +
+ URLEncoder.encode(type, getCharset()));
+ } catch (UnsupportedEncodingException e) {
+ throw new BuildException
+ ("Invalid 'charset' attribute: " + getCharset());
+ }
} else {
execute("/resources");
}
package org.apache.catalina.ant;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+
import org.apache.tools.ant.BuildException;
("Must specify 'path' attribute");
}
- execute("/undeploy?path=" + this.path);
+ try {
+ execute("/undeploy?path=" +
+ URLEncoder.encode(this.path, getCharset()));
+ } catch (UnsupportedEncodingException e) {
+ throw new BuildException
+ ("Invalid 'charset' attribute: " + getCharset());
+ }
}
General, Catalina, Coyote, Jasper, Cluster, Web applications, Extras, Tribes,
Other
-->
+<section name="Tomcat 7.0.10 (markt)">
+ <subsection name="Catalina">
+ <changelog>
+ <fix>
+ <bug>28852</bug>: Add URL encoding where missing to parameters in URLs
+ presented by Ant tasks to the Manager application. Based on a patch by
+ Stephane Bailliez. (mark)
+ </fix>
+ </changelog>
+ </subsection>
+</section>
<section name="Tomcat 7.0.9 (markt)">
<subsection name="Catalina">
<changelog>