rest - Spring 3 and JAXB -
i have implemented basic mvc app using spring, annotated class follows
i have added spring oxm pom, not added jaxb or json handlers.
my configuration pretty empty.
so question how spring producing xml output when call in controller , returning following object in xml.
where finding xml marshaller, in spring-oxm? there default?
is httpmessageconverters? set controller tot following:
@requestmapping(value= "/state", method = requestmethod.get, produces={mediatype.text_xml_value }) public responseentity<gamestate> getgamestate(.. response,... request) {..}
my object :
@xmlrootelement(name = "door") public class gamestate { private int id; private string state; public gamestate() { super(); } public gamestate(int id, string state) { this.id = id; this.state = state; } public int getid() { return id; } public void setid(int id) { this.id = id; } public string getstate() { return state; } public void setstate(string state) { this.state = state; } }
java 6 has jaxb built distro, specifying container ur looking
@xmlrootelement(name = "door")
if need more information on jaxb bundling here api documentation .
Comments
Post a Comment