Daily photograph for 2008-09-13 - "mushroom cloud"

Today's photograph on my photoblog, "Photo-Persistence"

Which Java MVC Framework to use?

I’ve got an idea for a web application I want to prototype and I was originally going to try to whip it up in Ruby on Rails (oh no! another convert!) but then I remembered I don’t know RoR yet and I think my time right now would be better spent actually coding something instead of diving into yet another thing to learn. I’ve been reading Ruby tutorials but it would probably take me a while to grok the switch and then implement my idea in Ruby. So, I’m sticking with Java. But I want to keep it lightweight. It doesn’t need a full J2EE backend. I’ve used Hibernate on a few projects, so I’ll probably stick with that for persistence. I’m looking for something lightweight on the front-end, comparable to Rails. Struts has always seemed too complex for what it needs to do, so I think that’s out of the question. I stumbled upon Rife the other day when reading a comparison on Java vs Ruby & the TadaList implementation.
Ideally what I’m looking for in a framework:

  • quick to learn
  • low configuration
  • not trying to do more than I really need it to do
  • view shouldn’t contain much/any code

What do you suggest? Leave me some comments.

Update: WebWork has been getting lots of positive feedback. I think I’m going to go ahead with Matt Raible’s Appfuse. I’ve done some investigation into it and it looks quite solid and I really like the ability to get up and going quickly. I don’t know Struts, but I’ve investigated Spring in the past and the combination of Struts + Spring + Hibernate looks pretty solid and well-proven. I also like the flexibility to pick & choose different components.

9 Responses to “Which Java MVC Framework to use?”

  1. Matt Raible Says:

    I’d have to give the quick to learn nod to WebWork - unfortunately, there’s not a book published on it. Using Equinox or AppFuse might help you get started quickly though. ;-)

  2. Brian McCallister Says:

    RIFE is probably the closest thing to rails — an integregrated full stack framework. It probably isn’t the easiest to learn (though is worth it). I’d second Matt’s comment on Webwork, for ease of learning.

  3. Lee Says:

    Yeah, webwork for sure - I’m just picking it up now, and its much easier to get into than Struts. If you are into TDD its also a hell of a lot easier to test your webwork/Xwork actions with JUnit, and ofcourse - using Xwork your actions are not tied to the web tier, so they can be reused in a console or swing app.

  4. ahmet Says:

    we use WebWork, it is nice and easy. but we maybe give a shot to Spring MVC for next project. it is a lower level MVC approach, but very strong and well documented. books are available too. Xwork is unfortunately not as strong as Spring’s IoC. when you need to use exptensively, it might give you pain because you will need to create and implement a lot of interfaces. Of course, let me add, you can use Spring + Webwork too for solving this problem. if your design is simple one very intresting approach Wicket (http://wicket.sourceforge.net/Features.html)can be you choices.

  5. Matt Raible Says:

    AppFuse supports WebWork as a web framework option so you can use WebWork + Spring + Hibernate if you like. Here’s a post on integrating WebWork and an WebWork Actions tutorial.

  6. Jonathan Locke Says:

    A company called Topicus in the Netherlands recently flew me out to Holland for a couple weeks to work on Wicket with the other Open Source developers on the project. Several Wicket developers work there and a lot of their new projects are starting up in Wicket. I think one of the reasons that they are so excited about Wicket is actually quite the opposite of what you suggest… they seem to be in love with Wicket mainly because even though it looks and feels simple, it helps them solve some really complex design / UI problems. I’ve seen some of these applications (which are being developed for some large public companies such as retailers and banks) and I’m blown away by how sophisticated Wicket applications have already become. In the interest of disclosure and honesty, I should mention that I am very biased being the original author of Wicket and now lead the Open Source project. But that doesn’t necessarily mean I’m wrong. ;-)

  7. Martijn Dashorst Says:

    We use Wicket in several medium and complex designs, even though it is pre 1.0. I can’t imagine doing our current web GUI’s in a second generation MVC framework.

  8. Calder Group Inc » Blog Archive » Top 5 Skills for Online Media Engineers Says:

    [...] What interests me the most is how shallow the tool box is. Take the MVC layer. I expected more variety like Wicket or Webwork. Struts is a good solution, but it doesn’t go far enough (especially in the view and model departments). Additional packages like Tiles and Sitemesh make a big difference. [...]

  9. Yunpeng Yin Says:

    until today, what you were looking for is still what i am looking for. Too many mvc solutions in Java world, I am confused and tired to make decision. Does anybody can give me some useful advice? How about the perform of Wicket in large and complex applications?

Leave a Reply