zebiri djallil zebiri djallil - 9 months ago 33
Java Question

Give a name to an XMLRootElement

This is my bean

package mypackage;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

@XmlType(propOrder={"columnName", "new_value"})
public class GetUserInfoResponse {

private String columnName;
private String new_value;

@XmlElement(nillable = true, name = "nomChamps")
public String getColumnName() {
return columnName;

@XmlElement(nillable = true, name = "ValeurModifiee")
public String getNew_value() {
return new_value;


And this is the result that i'm getting

"getUserInfoResponse": [
"nomChamps": "AD_Client_ID",
"ValeurModifiee": ""
"nomChamps": "AD_Org1_ID",
"ValeurModifiee": ""

I'm getting like a title
(name of the class java bean)

Now, i want to get a specific title (example
in the place of class java name)

like this
enter image description here

Answer Source

Its simple

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download