views:

479

answers:

3

Hello, I plan to begin learning a Java web framework (I love the Java API), I already used Rails and Django.

I want something close to Java, but without all the complexity of J2EE.

I've found 2 framework that could be good for me :

Grails : Grails looks great, it use Groovy that is better than Java for web application (I think..), but it's slower, that use pure-java components (Hibernate, Strut, Spring), it looks pretty simple to deploy (send .war and it's ok !), the GSP is great ! It's a bit harder to debug (need to restart the server at each modification, and the stacktrace is a mix of Java and Groovy stack that is not always understandable..)

Play! : This framework also looks great, it's faster than Grails (It's use directly Java), but I don't really like how it use Java, it modify the source code to transform the properties call as setXXX/getXXX, I'm not kind of that... The framework also have caching function that Grails don't (alreary) has. I don't really like the Template Engine. It's also easer to debug (no need to restart the server, and the stacktrace is clear)

What do you recommend for ? I am looking for something easy to learn (I used a lot ruby and java, but a little bit java (But I love the Java API)), that is full featured (That's no a problem with all the Java Library availables, but if it's bundle and integrated I prefer), that scale and that is not too slow (faster than ruby), and if possible I would want something with a decent community to easily find support and answer to my questions ;)

PS: No JRuby on Rails

Thank you !

+1  A: 

There is also Lift on Scala.
Imho scala is the best static typed language and lift is a pretty nice framework (for a static typed language).

clyfe
I took a look, I'm not really fan of the Scala language (functional part, and the syntax) and Lift looks really too young, there is no real user guide and the documentation is very poor :(
Kedare
+1  A: 

If you have used Ruby and Python before, you will probably enjoy Grails better than Play. It very hard to get back to Java once you are used to these dynamic languages.

Langali
+6  A: 

I'd suggest Grails. It has a bigger community than the play framework does (~350 plugins covering pretty much every basic need). Also, grails is written almost completely in Java, it just lets you use Groovy for your domain specific implementation.

If you do run into a performance issue where the groovy pages that you've created are the bottleneck, you can always just switch to a Java implementation. Then you're in the same boat that you would have been with the Play framework all the time. You've optimized your development time by putting off the coding of things in Java till you know that you actually need to do it (which, in my experience is very rare).

I'm also not sure where you heard that you need to restart your server for each modification, but that's actually not true. Grails supports reloading of controllers/gsps/services/domain objects, etc without restarting your server.

The mixed stacktraces can get a little long, but tool vendors (like Intellij) have made some recent improvements that strip out all the stacktrace portions that you don't care about.

I've been using grails since the .5 days and have been very happy with the platform.

Ted Naleid
Thanks for reply :)The strange thing about Grails is there is no possibility of output stream caching likes the rails cache_page, cache_action and cache_fragment, and on rails, when we don't cache, we get really slow performance, but if grails is natively faster than rails I don't know if that will be an issue for now. But when the website begin to grow, how can I do output caching ? (if possible distributed caching with something like memcached)
Kedare
You can cache page fragments with the Spring Cache plugin (http://grails.org/plugin/springcache) and you should also look at this: http://adhockery.blogspot.com/2010/02/full-page-caching-in-grails-with.html
Burt Beckwith
There are a few different solutions for speeding up grails output. The UI Performance plugin handles client side browser cache stuff like versioning images, setting appropriate headers, gathering up css/js files and packing/gzipping them for quick transport.http://www.grails.org/plugin/ui-performanceThe springcache plugin does more of the page/fragement caching. Underneath it uses the terracota ehcache-web implementation.http://www.grails.org/plugin/springcacheYou can also do distributed caching with terracotta's solutions as well.
Ted Naleid
Hmm okay, thank you, that looks harder than the rails automatic caching, but I'll try to use that ;)
Kedare