Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to Set a value for Xml Atribute in a response  RSS feed

Maya sekar
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everybody,

I am using Rest Web Services,
I use @XmlRootElement(name="") Annotation to change the xml tag value of the root element (i.e class name).
Say I wanted to use an annotation to change the attribute values, what annotation would I have to use,

SAy I have a bean

Class Bean
String firstName;
String surname;

//getter and setters

only using @XmlElement or @XmlAttribute throws an error com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException

What annotation should I use?

Thank you
Have a nice day
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!