2

I am looking at developing simple java web-app to be deployed on GAE and learn about Java web development in the process. I am not inclined to use RIA component-based frameworks like Wicket and Vaadin.

I have looked at Play 2.0, Tapestry 5 and Click, out of which Play 2.0 cannot be used on GAE (and I don't want to put efforts in learning Play 1.0 which is a thing of the past). I have no problem in using Javascript for client-side programming. So, I am not considering GWT.

I have read up some documentation. Click seems to be easy to deploy on GAE. But, Tapestry 5 seems like a good framework to study and learn and become a better software/web developer. But, my google search for using Tapestry with GAE yielded pages that talked about hacks to get it working on GAE instead of having a first-class support for GAE itself.

I do not mind putting in efforts to learn a complex framework if it is going to make me a better programmer. Does anyone have any experience with using Tapestry on GAE? Or should I just go for Click?

Salil
  • 9,534
  • 9
  • 42
  • 56
  • 1
    I wrote a GAE app in Scala, Scalatra, LiftJson, Objectify (ORM), Guice, and Specs2. This let me write Sinatra-style REST endpoints without a lot of complexity. The front-end was just a JS/PHP site on shared hosting. This avoided GAE costs for web traffic, let GAE do the heavy lifting, and was pretty snappy. Overall development was pretty painless. – Ben Manes Aug 09 '12 at 07:02
  • @BenManes, thanks a lot for offering an interesting alternative. Scalatra looks great and well-documented, which is very important for a newbie like me. Since you used different packages, did you face any integration issues? What I am afraid of is running into some integration issues later. – Salil Aug 09 '12 at 07:45
  • 1
    UI integration was easy since its just REST endpoints, so routes and json. That meant discovering bugs not found by tests and iterating on the api as the front-end was flushed out. For server-side I found GAE frustrating as not having friendly APIs (low-level, brittle, and not Java idiomatic). The maven/gradle plugins make releasing a breeze. Injection + mocks makes testing simple if you have an api/services/etc separation. – Ben Manes Aug 09 '12 at 09:41
  • @BenManes, looks like implementing REST services using lean web frameworks is the way to go for modern web-development. Thanks. – Salil Aug 09 '12 at 14:13

1 Answers1

5

In 2012 if you are serious about web development you need to use both server side and client side frameworks.

Here's what I recommend:

  1. Server-side: use something that gives you both HTML generation and REST/JSON support in one package. For Java a natural choice is JAX-RS standard. I use RESTEasy with HtmlEasy, where you can choose your template lib of choice. I recommend Silken.

  2. Client-side. Since you are java dev I recommend GWT. It's awesome. Just DO NOT use it's Widgets or UiBinder. Use pure HTML (it's generated on server, right) and then add code via GwtQuery. Also avoid GWT-RPC or RequestFactory, go with REST (GETResty or SpiffyUI).

ladaghini
  • 898
  • 1
  • 11
  • 22
Peter Knego
  • 79,991
  • 11
  • 123
  • 154
  • Actually, I am not that experienced in Java web development. A lot of what you mentioned is new to me. Thanks a lot for your answer. I thought I can learn one web framework and be done with it. But, it looks like, as always , there is a lot to learn :) – Salil Aug 09 '12 at 14:10
  • Peter, could you suggest some nice tutorials about RESTEasy. The information available on JBOSS site is underwhelming. Do we have automatic HTML generation for Jersey? – Salil Aug 10 '12 at 01:22
  • Hi Peterm, I would like to understand better your comment. Because I think that if you do not use Widgets, UiBinder, GWT-RPC or RequestFactory, you are not also using EventBus or Activity/Place and so on. Furthermore if the libraries you suggested are only porting of Javascript you risk to lose the end-to-end debugging process. I see the advantages of REST API, but on client side I prefer to use GWT plain because I do not want to lose the control and the optimization factors of GWT. What are you using of awesome of GWT? – Davide Ungari Aug 10 '12 at 11:52
  • @Salil: http://www.mkyong.com/tutorials/jax-rs-tutorials/ – Peter Knego Aug 10 '12 at 12:56
  • @ungarida: you can use MVP, EventBus, etc, without Widgets, that's what I do. The part I like about GWT is that I write Java and GWT produces highly optimized Javascript. – Peter Knego Aug 10 '12 at 13:01
  • any recommendations for year 2015 now? – Timeless Feb 17 '15 at 15:31
  • vue.js on client side, RESTEasy on server side for REST-JSON. For html generation/templating on both server+client side use https://mustache.github.io/. It needs a tiny glue code to work with RestEasy. – Peter Knego Feb 17 '15 at 19:10