I have been using Django with GAE/Python and recently I have been considering switching to GAE/J and GWT. My questions are

1) Is there a way to do hierarchical templating similar to the Django template system?

2) How do you manage static contents with/along with GWT in general?

I have been digging around quite a bit but I haven't been able to find something satisfactory. Here's a summary of the possible solution (I don't know if my conclusion of them are accurate though since I am not that familar with java tech.)

a) Use various java frameworks/template engine (Spring, FreeMarker, StringTemplate, Velocity, etc) but is it possible to mix use these with GWT?

b) Use Django with Jyphon... but then I am not really using GWT+servlet any more right? (And lose things like GWT RPC?)

c) Use JSP straight ... but there doesn't seem to be hierarchical template. As I type this I did some search and some have referenced Tile (http:/questions/490390/jsp-template-inheritance) does that work well with GWT?

d) Use GWT UiBinder. Base on the description of the dev guide, this seems to be exactly what I needed but then the examples I see are small and it seems to be best suited for layout of widget as oppose to a page. And using UiBinder means that the page is still js generated right? (not crawlable, etc?)

Again, some of the conclusion above could be wrong since I am new to the server side java tech. Please correct me if they are inaccurate.

  • This post stackoverflow.com/questions/1085898/… had a lot of relevant information for me. One particular note was that GWT client could be used with Python back end. – mjhm Nov 3 '10 at 16:12

For Templating try Sitemesh -- very easy to setup and use. I'm currently running an application on GAE with Spring/Sitemesh/GWT. The only reason I chose to use java is that GWT-RPC is written for it. The biggest problem with using Java on GAE is the cold-start issue: read this post This actually is a huge obstacle, so think twice before moving to Java.

  • Well, Spring is very heavy weight for cold starting on GAE, so if you're going with Java, you might considering using something else (Guice for example). – Arthur Maltson Nov 4 '10 at 17:16
  • I think this cold start issue may not be limited to GAE/J. I have experience similar lag in GAE/Python although not as severe (around 2~3 sec.) In the python case, it's the spin up of my Django framework. – Ken Nov 5 '10 at 11:37
  • It doesn't matter which framework you use, as long as it's Java, the cold-start time is going to be unacceptable. Even a 5 second wait is enough to turn users away, so the best approach, for now, is to use python. The post that I linked discusses the issue, including the future of 'reserved' instances and 'warm-up hooks'. – Vladimir Nov 5 '10 at 22:27
  • BTW, at the present time, I've setup my application in such a way that the first page that a user would access is a static page, which fires an async call to the backend to kickstart the application (I'm also using a cron job to do the same, if the user accesses the application from a search result, which would take him to the non-static content). But this is a hack, and the reason I'm fine with it is that I'm planning on rolling out the full-fledged application early next year -- by that time I'm hoping that the issue is resolved, or at least improved. – Vladimir Nov 5 '10 at 22:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.