Announcement Announcement Module
No announcement yet.
Roo Best Practices for JSON Restful Client Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Roo Best Practices for JSON Restful Client

    Hi, I'm new in Roo,
    Need you guys advice for this.

    I have 4 apps : 2 roo based & the other is just UI

    UI1, UI2 --> ROO1 --> ROO2

    ROO1 is listening for UI1 & UI2 (RESTful - JSON ) and also send JSON Request to ROO2
    ROO2 is listening for ROO1

    For now in ROO1 I use Roo restful web service & add on json (flexjson) as listening side & simple HTTPURLConnection OutputStream to send JSON request to ROO2, is this the best way to do it ?

    I ever heard about Spring RestTemplate, it said that RestTemplate is using Jackson and Roo add on JSON using flexJSON.

    What is the best way to add json restful client to ROO ?

    Thanks in advance.

  • #2

    When I work with JSON in roo projects i use RestTemplates and mvc @ResponseBody to produce JSON serialized objects. By default MessageConvertor uses Jackson JSON mapping. I found more convenient to me.

    When you need connection to rest service (e.g. Facebook) the best way is to use spring RestTemplate. Be aware that lots of rest implementation dont't send correct headers (Application/json but rather the text/plain or text/html) and you need to add those MessageConvertors in restTemplate initialization.


    • #3
      By default roo is using flexjson (roo json add on) so do you think we better not using this add on ?
      Ok I'll try RestTemplate