Writing attributes (write) Writing an attribute is quite similar to reading one, except that the request takes an additional value element.
GET write request Writing an attribute wit an GET request, an URL with the following format has to be used: /write////]]> GET Write Request
Part Description Example
<mbean name> MBean's ObjectName java.lang:type=ClassLoading
<attribute name> Name of attribute to set Verbose
<value> The attribute name to value. The value must be serializable as described in . true
<path> Inner path for accessing the parent object on which to set the value. (See also ). Note, that this is not the path to the attribute itself, but to the object carrying this attribute. With a given path it is possible to deeply set an value on a complex object.
For example, you can set the garbage collector to verbose mode by using something like http://localhost:8080/jolokia/write/java.lang:type=Memory/Verbose/true
POST write request The keys which are evaluated for a POST write request are: POST Write Request
Key Description Example
type write
mbean MBean's ObjectName java.lang:type=ClassLoading
attribute Name of attribute to set Verbose
value The attribute name to value. The value must be serializable as described in . true
path An optional inner path for specifying an inner object on which to set the value. See for more on inner paths.
Write response As response for a write operation the old attribute's value is returned. For a request you get the answer (supposed that verbose mode was switched off for class loading at the time this request was sent) The response is quite similar to the read operation except for the additional value element in the request (and of course, the different type).