views:

1328

answers:

12

I'm interested in a learning a java web development framework and I'm looking for some recommendations/suggestions on which one I should learn (and why).

Ideally, I'd like the framework to:

  1. Be MVC based.
  2. Have minimal if any configuration
  3. Have an easy to use ORM
  4. Have decent session management
  5. Be easy to pickup

I'm familiar with pylons and django so if there's a java framework similar to either one of those then I'd be especially interested in it.

Thanks.


Conclusion:

First and foremost, I'd like to thank those that took the time to share their insights. Over the past few weeks, I tried out Spring MVC, Wicket, and Stripes. Ultimately, I chose Stripes for all the reasons "Civil Disobedient" described; surprisingly not one of his statements turned out to be hyperbolic. In conjunction with Stripes, I'm using JPA/Hibernate. One concern I had was the Stripes community seemed relatively "small" when compared to Struts2, JSF, etc. While it maybe comparatively small, the community is very accessible, friendly and helpful.

Lastly, while I did not try out Grails, I did look into it and it looks very interesting/promising. From what I've seen, Groovy syntax looks very similar to python (since I'm familiar w/ python, that would make it easier for me to learn) and the Grails framework itself seems to be a RAD framework comparable to Rails, Django/Pylons. I certainly plan to look further into and (in the near future) eventually learn groovy/grails.

+10  A: 

Grails may well be what you're looking for. It runs on Groovy (one of the more popular JVM-based languages).

It uses a coding-by-convention methodology, so there's little configuration.

It's MVC-based and has its own ORM (called GORM), but you can plug in Hibernate (possibly the most popular Java ORM).

Brian Agnew
+1 - I've never used Grails, but from what I've seen of the documentation, it looks like it fits the bill for what Dan's looking for. Incidentally, once you have Grails up and running it looks like you can code for it in Java, Groovy, or (probably) any other JVM language.
rtperson
That's right. As you're using Groovy, you can plug in *any* Java class (created via *any* other JVM-compatible language)
Brian Agnew
+1 for Grails, IMO an excellent choice for a java programmer
ammoQ
+3  A: 

I believe that Spring Web MVC will meet your requirements.

Spring About Page

AlexCuse
-1; no mention which part of Spring
Rob
Thought it could be inferred from the question, but fixed that for you.
AlexCuse
+8  A: 

Good luck. The question you've asked is roughly akin to "I want a grilled roast-beef sandwich, made from chicken." The frameworks available in Java tend to be heavy on the configuration and a bit hard to learn.

That said, here are my suggestions:

  1. MVC Based -- Spring MVC or JSF, neither of which is particularly easy to learn. I haven't used any other MVC web frameworks (Wicket, Tapestry, etc.), so someone else may have to weigh in here.
  2. Minimal Configuration -- Your best bet is Spring MVC with annotations. But this is Java -- configuration hell is the name of the game.
  3. Easy to use ORM -- I'm not sure what you're used to in other languages, but in Java ORMs don't come baked into the MVC framework. Your best bet for an easy-to-use ORM is JPA on top of Hibernate, particularly if you shell out the $60 US for MyEclipse. The JPA implementation in MyEclipse is alone more than worth the investment. It's not perfect, just better than anything else I've seen.
  4. Have Decent Session Management -- Take your pick. Since the late 90s, J2EE containers have been managing more sessions than you'll likely ever need.
  5. Easy to Pickup -- Nothing that comes to mind. As easy as Java is as a language, the web tools associated with it tend to be what rough up newbies the most. Learn JSPs and stay away from JSF, as it has an eccentric lifecycle that tends to hide errors that you really want to know about.

Good luck!

Edit: I've never used Grails, but I have to concur with Brian and Nathan in saying that it looks like the best fit for what you're looking for.

rtperson
mlk
I don't know about: "...a grilled roast-beef sandwich, made from chicken," but in Texas you can get "Chicken Fried Steak" :-)Thanks for the heads-up on ORMs - JPA/Hibernate was relatively easy to pick-up.
Dan
+3  A: 

My favorite is the stripes framework. www.stripesframework.org. Very simple and flexible. Sorry didn't notice the orm component. You'll need a separate ORM, like hibernate.

However, grails does encompass your whole list.

Nathan Feger
+3  A: 

You can try out Wicket and tapestry. These are more capable frameworks. Both are built on different set of ideas.

muthu
+1  A: 

You could try Tapestry 5. It is a MVC-, component-based web framework, with almost zero configuration (convention over configuration, Ruby on Rails-like). It is easier to learn than JSF, for example (JSF is another component based framework).

Tapestry 5 has a lot of out-of-the-box components and easy and clean integration with Hibernate (ORM) and Struts (middleware). Oh, and the live reloading feature is impressive.

matheus.emm
+1  A: 

Since you said you wanted a "Java" web framework, I recommend either Wicket, GWT or RAP.

Wicket is a very simple, "bare metal" framework where all logic is in Java (rather than being split between Java and JSP as in Struts, JSF or other such frameworks). It is also component oriented, which means you can reuse the same GUI component (be it simple or composite) in different pages. Finally, Wicket allows to use AJAX, while still not requiring your whole page to be written in Javascript (as extjs requires, for example)

GWT and RAP are both "java to javascript compilers". You write your code in regular Java, including the logic for interaction on the client side (responding to clicks, drags, etc.) and the framework compiles the code to javascript that runs on the client and interacts with the server when needed. GWT (from google) is based on the swing model, while RAP (from eclipse) is based on Eclipse's RCP model (which is much richer than swing).

The main difference between Wicket and GWT/RAP is that wicket is more oriented towards writing "old school" sites (for example, stackoverflow is old school - pages, forms, with a bit of ajax), while GWT/RAP are for writing RIA applications (where there's many widgets with complex interaction).

Finally, for "out of the box" alternatives, check out extjs, cappucino and maybe java web start

IttayD
+5  A: 

Stripes is without a doubt the best and easiest java framework I've ever had the pleasure of using. To address each of your reqs:

Be MVC based.

MVC is sort-of in the eye of the beholder--at least, this depends heavily on how you design your code structure. But yes, it's quite simple to use an MVC project structure with Stripes.

Have minimal if any configuration

This is where Stripes shines. To get up and running you need only to put a few lines in your web.xml. Everything else is automagically wired-up. The beauty of Stripes is that everything can be easily overridden if you so desire.

Have an easy to use ORM

Stripernate is a popular extension to the framework that, again, works automagically.

Have decent session management

As simple as a @Session annotation on the field. Or you can persist the entire ActionBean in the session if you want. Stripes has built-in support for Wizards, so you don't have to concern yourself about preserving state across requests.

Be easy to pickup

This is Stripes' strongest suit. Not to mention, the Wiki is incredibly well-documented.

In addition, Stripes has built-in support for layout templates, localization, AJAX, and a bunch of other stuff. And unlike some frameworks that require dozens of gigantic JARs (cough... Tapestry), the entire framework is a single JAR that weighs in at less than 500 KB.

Civil Disobedient
+1  A: 

Try HybridJava http://www.hybridserverpages.com/

It exactly matches your requirements except maybe that it has no own ORM. But that may in fact mean an ease of Use

Alex

Dima
+6  A: 

I would highly recommend using ZK. I have used it for numerous projects and found it to be extremely productive and reliable. It is constantly updated and the new version (5.0 I think) includes both server-centric architecture and the ability to customize the client.

ZK 5 has jQuery integration, which you can use if you want to get your hands dirty with Javascript, although this is completely optional. I have also read that GWT is going to be implemented so that full client-side customization is available using Java.

It satifies your 5 criteria and can also be used in conjuction with Grails (see here). Here are some links to get your started:

I hope these help you!

Jonathan
I would add : "Use ZK with Grails ! You get the benefits of both !" :-)
Philippe
+1  A: 

How about Hamlets?

Hamlets (previously known as IBM Servlet-based Content Creation Framework) is an open source system for generating dynamic web-pages developed by René Pawlitzek at IBM. A Hamlet is a servlet extension that reads XHTML template files containing presentation using SAX (the Simple API for XML) and dynamically adds content on the fly to those places in the template which are marked with special tags and IDs using a small set of callback functions. A template compiler can be used to accelerate Hamlets.

Hamlets provide an easy-to-use, easy-to-understand, lightweight, small-footprint, servlet-based content creation framework that facilitates the development of Web-based applications. The Hamlets framework not only supports but also enforces the complete separation of content and presentation. It is the result of a radical software simplification effort.

Prince of Denmark
A: 

Hamlets link: http://hamlets.sourceforge.net

Prince of Denmark