/java/

Spring3 Hibernate RESTFul simple example

2013-01-12 21:22:38

What is RESTfull ?? You can find description on http://en.wikipedia.org/wiki/Representational_state_transfer

My example is simple because I start learn java

Everything you can find in github https://github.com/szalek/examples/tree/master/java/RESTFul

What is important ?

  1. @ResponseBody Respons Object is automatically conver to xml
  2. @RequestBody Request XML is automatically conver to Object
  3. @XmlType(propOrder={"id", "name", "content"}) You can change Order fields.
  4. PUT and POST, if you use hibernate method saveOrUpdate, you can have only one method to save or update object
  5. @XmlRootElement(name = "posts"), @XmlElement(name = "post") You can change elements' name.