How can I Convert XML to an Object using Spring 3.0 mvc while making RESTful request

Posted by brock on Stack Overflow See other posts from Stack Overflow or by brock
Published on 2009-11-06T21:35:26Z Indexed on 2010/05/15 23:30 UTC
Read the original article Hit count: 358

Filed under:
|
|
|
|

Hi, I'm using the Spring 3.0 RC1 framework and I'm currently testing out Spring mvc. I wanted to use Spring mvc to handle restful requests. I have set up my controller to handle the URI request. I am passing in xml with the request. So on the controller I have a method like follows:

public void request(RequestObject request) {
  doSomething();
}

I am having a hard time converting the xml to the RequestObject. I haven't seen much documentation on this and I was wondering if anyone could point me in the right direction. I'm guess that you would have to annotate the RequestObject using JAXB or something in order to tell Spring to convert the xml file to RequestObject but I'm not sure.

Thanks for all of your help!!

© Stack Overflow or respective owner

Related posts about java

Related posts about spring