Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which java web framework to learn? [closed]

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.

like image 736
Dan Avatar asked Oct 08 '09 16:10

Dan


4 Answers

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).

like image 168
Brian Agnew Avatar answered Oct 21 '22 16:10

Brian Agnew


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.

like image 41
Civil Disobedient Avatar answered Oct 21 '22 15:10

Civil Disobedient


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.

like image 34
rtperson Avatar answered Oct 21 '22 16:10

rtperson


Take a look at http://www.playframework.org/.

like image 28
sojin Avatar answered Oct 21 '22 16:10

sojin