3

I am using Spring/SpringMVC and I want to serialize a POJO to application/x-www-form-urlencoded representation - the very same representation that a Spring @Controller would be able to bind to a POJO if submitted via a POST request for example.

Anyone has an idea in which Spring Components should I be looking?

Spase Markovski
  • 653
  • 1
  • 8
  • 22

1 Answers1

0

Have a look at this HTTP message converter implementation. Register that in Spring MVC configuration on the server-side or a RestTemplate on the client side.

Jukka
  • 4,583
  • 18
  • 14
  • I don't want to create the MultiValueMap, but Spring to do it for me. :) I have complex POJO with multiple properties - each few layers deep. – Spase Markovski Jan 28 '14 at 20:29
  • My guess there is nothing out of the box to do the object => map conversion for you. Have a look at this thread for ideas: http://stackoverflow.com/questions/6796187/java-introspection-object-to-map – Jukka Jan 28 '14 at 20:40