Matt RaibleMatt Raible is a Web Developer and Java Champion. Connect with him on LinkedIn.

The Angular Mini-Book The Angular Mini-Book is a guide to getting started with Angular. You'll learn how to develop a bare-bones application, test it, and deploy it. Then you'll move on to adding Bootstrap, Angular Material, continuous integration, and authentication.

Spring Boot is a popular framework for building REST APIs. You'll learn how to integrate Angular with Spring Boot and use security best practices like HTTPS and a content security policy.

For book updates, follow @angular_book on Twitter.

The JHipster Mini-Book The JHipster Mini-Book is a guide to getting started with hip technologies today: Angular, Bootstrap, and Spring Boot. All of these frameworks are wrapped up in an easy-to-use project called JHipster.

This book shows you how to build an app with JHipster, and guides you through the plethora of tools, techniques and options you can use. Furthermore, it explains the UI and API building blocks so you understand the underpinnings of your great application.

For book updates, follow @jhipster-book on Twitter.

10+ YEARS


Over 10 years ago, I wrote my first blog post. Since then, I've authored books, had kids, traveled the world, found Trish and blogged about it all.

OSCON 2007: Comparing Java Web Frameworks

This afternoon I delivered my Comparing Java Web Frameworks talk at OSCON in Portland. I told attendees I'd post it here afterwards, so here it is:Download Comparing Java Web Frameworks Presentation (5.1 MB)

For comments on this presentation from earlier this year, see related postings from ApacheCon EU and JA-SIG. This presentation is pretty much the same as the one from ApacheCon and JA-SIG, except it has a different theme and I chopped out the Sweetspots section (due to time constraints).

Portland is great this time of year, but unfortunately I won't be sticking around. I'm heading down to Salem to work remotely for a couple of days, returning for the Oregon Brewers Festival on Friday and heading back to Denver on Saturday. I'll be glad when July is over - I've traveled to a new state every week.

Posted in Java at Jul 25 2007, 04:50:55 PM MDT 9 Comments
Comments:

So... which would you use? The main goal being enjoyment and maintenance of an ongoing project (and no dependency on "POST"). I'm using Struts 2 at the moment - it has proven rather annoying with the bugs in creating custom FTL themes, and the mystical powers of their validation and its tie ins with i18n keys. I dream of going back to SpringMVC. I can live with the lack of a central base controller because the framework gels with how I would approach problems (more than struts2).

Posted by Ned on July 26, 2007 at 12:52 AM MDT #

Hi Matt,

I'd like to try to make a couple of points of constructive criticism. I'll declare here that I'm a big fan of stripes and so this will be somewhat one-sided, but I will attempt to remain balanced. I also realise that out of the frameworks included, you have the least experience in stripes and so some omissions are to be expected.

  • I object to the inclusion of job related statistics in the comparison. The critieria should be "what is best for this project", not "will this look good on my resume". I realise you included several other valid criteria, but I can't not object to the inclusion of that one.
  • I don't see the Stripes Con of "Hard-coded URLs in action beans" as a con. To me its a pro of "URL configured alongside code". We (the industry) have tried configuring everything in XML, and we all (well most) ended up using xdoclet or something similar to generate the XML based on something we put in the code. Using annotations simply removes the compile step from this process.
  • afaik all the frameworks (certainly stripes can) can be used with freemarker or velocity. As I understand it both of these use a servlet for rendering so it is simply a matter of having the framework dispatch the request to the relevant servlet.
  • Re decoration, I really like the stripes model (see http://mc4j.org/confluence/display/stripes/Layout+Reuse) which seems to have been forgetton in the decoration section.
  • The two mailing list traffic slides are not distinguished - I assume #47 is user and #48 dev.
To wrap up - we did an internal review of what to use moving forward, looking at Struts2, Spring and Stripes and we all agreed that Stripes is the road forward. Since then we've all enjoyed it.

cheers,
dim

ps - if my children ever do that to my TV I think I'll cry!

Posted by Dmitri Colebatch on July 26, 2007 at 01:43 AM MDT #

To evaluate a framework, there is another important criterion, that is accessibility, since many countries have enforced their law on this subject. Many frameworks offer now "cool stuff" like ajax support and other javascript libs, but do they propose workarounds without JS ?

Btw, I love slide 17 in your presentation ! I'm happy it's not my living room !!!

Posted by Tristan Marly on July 26, 2007 at 07:19 AM MDT #

As far as Wicket goes, one of your "Pros" effectively says 'Not great for web developers', which I'd suggest is misleading, as one of the features of Wicket is to keep the HTML templates as easy to use, preview and maintain by web developers who don't need to know the functional details in the Java code. You 'con' of "HTML templates live next to Java code" is also incorrect - it's the default option, for some very good reasons, but it's not mandatory. I'm not actually convinced of the others & would suggest that if you can't find any real 'cons', just leave the space blank! :-)

Posted by Gwyn Evans on July 26, 2007 at 01:51 PM MDT #

> So... which one would you use?

It depends on the application I'm building. If it's for a high-traffic, consumer-facing site that needs to be stateless, I think it makes sense to use something like Spring MVC, Struts 2 or Stripes. I like the programming model behind Stripes and Struts 2 moreso than Spring MVC. I haven't had any issues with Struts 2 like you have, but I agree that changing the FreeMarker themes aren't as clean as I'd like. When I set the default theme to "simple", I expect no HTML to be randomly inserted. Stripes is good, but it's a tough sell to companies when the community is so much smaller than the rest of the frameworks. Also, while its user community is strong and passionate, it doesn't seem like their developer community is that strong. The whole "lead developer gets hit by a bus" syndrome.

If it's not Struts 2 or Stripes, I really like Wicket. I also believe that Tapestry 5 will be a strong contender. However, with Tapestry's current project instability (why start with 4 when there's no upgrade path? why start with 5 when there's little documentation and only preview releases?) - it seems foolish to recommend it to companies. Especially when they're building their 5-10 year future platform on a framework.

Dmitri - Stripes does a lot better when you're choosing a framework for developers. However, you often have to choose a framework both for developers and for a company. Will Stripes be around in 5 years? Probably, but there's no books about it and it's often unheard of on developer's resume. Both you and I know a competent developer can learn most of it in a day, but companies like to see it on resumes. As far as hard-coding URLs in action beans - I say the same thing as you do in my talk. For decoration, it's interesting to see that Stripes has a layout feature. However, looking at that page - it looks like Tim admits it's primitive and recommends SiteMesh. The two mailing list traffic slides are both "user" list traffic - the 2nd one is to show that GWT is the new leader in Java Web Framework Mailing List Traffic. Does that mean anything? Who knows - but it makes for a pretty graph in a presentation. ;-) The Wicket Guys used to say that mailing list traffic meant nothing, but now that they're neck-in-neck with Struts, I doubt they have the same opinion.

Tristan - I absolutely agree with you. AFAIK, Struts 2 and JSF's Ajax support are all-or-nothing. If JavaScript is on, they work. If it's off, they don't work. I've heard from Tapestry's Jesse K. that Tapestry's Ajax support is not all-or-nothing and everything continues to work when JavaScript is off. Most organizations with sites that define their business use "progressive enhancement" for Ajax stuff. Java developers create Web 1.0-style applications, web developers use Ajax to modify the page and Ajaxify them. Frameworks that make this difficult are not good IMO.

Gwyn - on my current project, we removed Wicket as a candidate for two reasons: 1) no conditionals in templates and 2) stateful by default. I know it's possible to make Wicket stateless, but when developing a high-traffic site, it seems logical to *not* choose a component-based framework. Also, Wicket's EL in templates is very limited and doesn't allow calling methods with parameters, nor doing conditional logic. While you may say there's workarounds for this, this was a deal-breaker from the web developers' perspectives. As far as HTML templates live next to Java code, I'm aware this is only the default and it's changeable. I say this in my talk. However, it's not web developer-friendly out-of-the-box, so that says something to me.

Thanks for the great comments everyone!

Posted by Matt Raible on July 26, 2007 at 03:00 PM MDT #

Hi Matt

I wrote a plugin for Stripes integration into IntelliJ IDEA (Selena version) IntelliStripes. Is in beta stage, but is usable right now. I hope add some extra functionalities in the next weeks

Thanks for your comments and suggestions

Posted by Mario Arias on July 29, 2007 at 11:32 PM MDT #

What about ZK? It often listed as the most active project on sourceforge, but it's rarely mentioned in these "java web frameworks compared" blog articels you see around the place.

How can it be both popular, and not mentioned in the Java blogosphere?

David

Posted by David Roussel on August 09, 2007 at 05:11 PM MDT #

David - maybe it's not that popular or I'm living under a rock? ;-) It could certainly be the latter. I've started hearing more and more about it recently, mostly from blog comments. To me, it sounds a lot like GWT or Echo2. IMO, these frameworks are only usable for certain applications. Would you agree?

Posted by Matt Raible on August 09, 2007 at 05:21 PM MDT #

ZK is in stateful intranet apps catagory, and to me it looks pretty ugly, but I've not tried it so not sure how easy to use it is. But it does seem to have some attraction. Looks like Luntbuild 2.0 might be built using it.

Posted by David Roussel on August 10, 2007 at 03:40 PM MDT #

Post a Comment:
  • HTML Syntax: Allowed