My personal choice is RESTeasy with Htmleasy. Also Jackson if you need JSON.
RESTeasy:
- JAX-RS standard based open-source lib from one of Java open-source leaders. Excellent support.
- MVC based.
- Great docs, lots of examples.
- Works on GAE without any problems.
- Comes bundled with Jackson if you need to serve JSON (= you have mobile clients).
Htmleasy
- Lightweight, builds upon JAX-RS and RESTeasy
- Can use different html templating engines including JSP and Mustache.
- Works with Mustache, which can be servers side (server Java renders template) or client side (JS renders template AJAX style).
Suggestions:
- Same code base can serve both HTML and JSON, supporting web and mobile clients.
- Find right balance between server-side rendering and client-side rendering & AJAX. Remember, biggest sites use both: servers-side to quickly give you first page, client-side & AJAX for great responsiveness to user actions.
- Do not put your business & database logic in JAX-RS methods, create a separate business layer classes instead.
- Unit test the business layer - you should have 100% coverage.