RESTful on Play! framework
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: We are planning a project primarily serving content to mobile apps, but need to have a website. My question is whether is makes sense to use Jersey or Restlet to develop REST APIs for our mobile apps, and then use Play! to serve the website. Or does it make more sense to just use Play! to do it all? If so, how to do REST with Play! framework? 回答1: As per request, a simple REST-like approach. It works almost the same way Codemwncis' solution works but uses the Accept header for content negotiation. First the routes file: GET /user/{id}