Matt RaibleMatt Raible is a writer with a passion for software. 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.
You searched this site for "java web frameworks comparison". 2,229 entries found.

You can also try this same search on Google.

Moving

Today is move-in day to our remodeled house. The final trim installation and a the last few doors should be done sometime this afternoon. It's hard to believe it's almost done. It's been a long journey since construction started in March. There were a few interesting times along the way, like the garage demolition and basement wall falling off. It's tough to mention it, but it wouldn't be right to talk about this finished house without taking a moment to remember Bob the Builder. He would be smiling from ear to ear if he was here today.

It's been 7 months since we moved into our current house. After living in sub-1000 sq. ft. houses for the last 15 months, it'll be nice to get some space again. Total square footage on new house? Somewhere around 2500 square feet! Here's a comparison between old and new (click to zoom in):

Old House
Old House
New House
New House

Posted in General at Oct 22 2004, 06:02:35 AM MDT 6 Comments

Comparing Web Frameworks: Equinox, Ant and Maven

Next week I'll be putting together the sample apps for my Comparing Web Frameworks talk. They're going to be pretty simple. They'll be created using Equinox and will closely resemble the MyUsers app created in Chapter 2 of Spring Live. That is, they'll just be simple webapps that allow you to CRUD a database table. MyUsers just edits a user's first and last name, but I'll probably add a "birthday" field to demonstrate Date handling. Even though it's simple, it'll have a pageable/sortable list, validation and success messages - which is what most apps need. Of course, if I can't get X feature to work, I'll make sure and highlight that in my talk.

Equinox is based on Ant and works quite well. However, I have a Maven version of Equinox that I developed for Open Logic this summer. They've been gracious enough to let me release this as open source. BTW, if you're looking for a rich set of Maven sample apps - Blue Glue 3.1 will have a few (including multi-project). Blue Glue also contains detailed documentation on each of these sample apps I'm creating for this talk.

So the question is - should I release a Mavenized version of Equinox? Or should I modify Equinox to contain and allow you to use both Ant and Maven? The problem with allowing both is I'd likely give up everyone's favorite Maven feature - downloading dependencies. I personally have grown to loath this feature b/c repositories are hardly ever up-to-date and I spend a lot more time trying to get repositories updated (or creating my own) than I would downloading the JAR. Spring uses both and simply points Maven to its local JARs. That's probably what I'd do.

Of course, the easiest (and KISS) thing to do is to use Equinox with Ant and not complicate things. However, I'm willing to put in a couple hours to try and make Equinox allow both. Regardless, I'm willing to release a Mavenized version of Equinox - if there's interest.

P.S. Don't forget to thank the Open Logic guys for making this all possible. I wouldn't have been able to do this talk without their generous donation.

Posted in Java at Oct 21 2004, 02:57:52 PM MDT 3 Comments

AppFuse's License

Someone sent me an e-mail today and made me aware that the Commons Attribute License that AppFuse uses only applies to documents and such:

"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole.

Because of this, I'm thinking of switching to use an Apache 2 License. This seems to be the friendliest license for open source. Basically, all I want to do is try to get folks that use AppFuse to give it some credit. Which really means they're marketing it in a sense. More marketing -> more users -> (hopefully) I'll stay employed and the product will get better.

The only pain I can see about licensing with an Apache License is they want you to add a short copyright notice at the top. But I'm not really handing the copyright of AppFuse over to ASF, am I? Do I have to add this copyright to all my .java files? I know that Spring does this, but... ugh ... seems rather unnecessary.

Posted in Java at Oct 21 2004, 10:54:08 AM MDT 11 Comments

Automating the new house

Automating your project might be cool, but what about your home? In a recent Macworld issue, there's an article titled Automate Your Home. After reading it, I became inspired to do some automation in the new house. Since we're scheduled to move in this weekend, I'm getting close to buying the software and hardware necessary to do this. The top software packages seem to be Indigo (for OS X) and Active Home (for Windows).

I'm leaning towards the Windows version since my Windows box is always on and there's likely more information/experience working with that version. My PowerBook gets turned off frequently, so that's not a good idea. I could buy a new G5, but $4000 for home automation is a bit spendy. In reality, I'd like to find a easy-to-use (and install!) version for Linux since my Linux box is always on. Any tips?

I'd love to hear any experiences folks may have with automating their homes. Initially, I plan on automating light activation when you walk in the room. Any other cool ideas?

Posted in General at Oct 20 2004, 09:36:09 AM MDT 8 Comments

MyJavaPack - an Open Source version of Blue Glue?

As noted by John Munsch, MyJavaPack looks pretty cool. At first glance, it looks like an open-source version of Open Logic's Blue Glue. Since I actually did some work on Blue Glue this summer, I downloaded MyJavaPack and did a a quick install.

I was quite impressed. All it did was download the packages I requested and installed them. In most cases, this is what I want - especially on my machine where I already have everything setup. Blue Glue goes a bit further than MyJavaPack. It installs and configures everything for you. This is great for brand new machines, but can be a pain for pre-configured machines since it adds stuff to your PATH.

The thing I like about MyJavaPack is that it's open-source. Therefore, I might be able to dig in and customize it for an AppFuse-based installer. Such an intaller would include tools for developing AppFuse: Ant, Tomcat, MySQL, Eclipse and AppFuse. That'd be pretty cool to be able to download and install an entire development environment.

Neither product does what we all really want: the ability to do an "update" (like Windows Update or Software Update on OS X) of our existing packages.

Posted in Java at Oct 19 2004, 11:12:19 AM MDT 4 Comments

Java Developers - let's take over the MySQL Conference!

Last April, I attended the MySQL Conference in Orlando. It was a good time, but the number of Java Developers there was pitiful. I had a good time hanging out with Mark (Matthews) and Anthony, but it was still a poor showing. Now MySQL is gearing up for this year's conference (April in Santa Clara) and I'm thinking about submitting a proposal. Anyone interested in joining me? Let's bombard them with proposals and see if we can take over the sucker! If nothing else, it'd be cool to hang with more Java Developers in California.

The conference actually ends the day before Julie and I's 5th year anniversary (April 22nd). If my proposal gets accepted - I think we're going to have Julie's sister babysit and Julie will fly out to spend the weekend touring around wine country. Sounds like fun, eh? Now I just need to find some sort of limo so we can do lots of tasting. ;-)

Posted in Java at Oct 19 2004, 10:32:36 AM MDT 11 Comments

Tapestry Tutorial Roundup

I'm going to start integrating Tapestry into AppFuse in the next few weeks. There's nothing like a good set of tutorials to help this process along. Here's a list of current tutorials I found - let me know if you know of others:

There also seems to be an up-to-date list of Tapestry Resources on Java201.com. I've started reading Tapestry in Action, so hopefully that will speed things up. I've made it to page 100 and I'm afraid I won't make it much further. I need to "just do it" more than I need to learn how to do it. I've often found that I learn a lot more after diving into the code and trying to do something and go back to reading when I start banging my head against the wall.

Integrating Tapestry into AppFuse shouldn't be that hard. I've already done it with the MyUsers application from Spring Live. Therefore, the Tapestry+Spring stuff will be easy. The only hard part, as far as I can tell, is going to be integrating Friendly URLs. Anyone got a patch for Tapestry 3.0.1?

Posted in Java at Oct 18 2004, 07:39:08 AM MDT 5 Comments

Comparing Web Frameworks: Presentation Outline

My Comparing Web Frameworks outline is due to the ApacheCon Planners today. I spent a couple of hours putting it together this morning and I'm mostly done. In reality, I know that I won't cover the things that everyone wants to know. In an ideal world, I could simply target the presentation towards people like me: they know Struts but want to learn more about the other frameworks. Before diving in, they want to know some things to watch out for.

The problem with doing that is writing for people like me sometimes backfires. I'd like to make it an advanced presentation, but I'm not an authority on all 5 frameworks - so that seems a bit far fetched. However, if I could add Tapestry and JSF support to AppFuse in the next two weeks - I'd have a lot more experience to refer to. But that ain't gonna happen - the first update chapter for Spring Live is due next week. OK, enough rambling - here's the slide titles I've come up with. So far, it's 22 slides and shouldn't grow any since it's supposed to be finalized when I submit it.

  • Who is Matt Raible? My background, open source involvement, etc. Trying to give myself some credibility. ;-)
  • Framework Experience: Long time Struts user, used Spring since end of last year, developed apps with other three this summer. AppFuse supports Struts, Spring MVC and WebWork; Tapestry and JSF coming before end of year.
  • Meet the Candidates
    • Struts: Pros and Cons. Pretty much a standard, lots of examples, HTML tag library kicks ass. ActionForms kinda suck, can't unit test (only StrutsTestCase integration tests), Mailing list is swamped.
    • Spring MVC: Nice lifecyle (for overriding binding, validation, etc.) integrates with many view options seamlessly, IoC for easy testability. Not widely used, requires lots of code in JSPs, almost too flexible (no parent controller for SimpleFormController and Controller).
    • WebWork: Simple architecture, tag library easy to customize, interceptors are pretty slick. Documentation only recently written, few examples, client-side validation needs work.
    • Tapestry: Very productive once you learn it, templates are HTML (great for designers), healthy project. Documentation very conceptual, rather than pragmatic (lots of "read the book"). Steep learning curve, few examples. Impossible to test - page classes are abstract.
    • JSF: J2EE standard (lots of demand and jobs), fast and easy to develop with, rich navigation framework. Tag soup for JSPs, a bit immature (doesn't come with everything), no single source for implementation.
  • Controllers and Views: Show controllers for all 5 frameworks and template page (JSP/HTML) for forms. Give URL to download sample apps.
  • List Screens: How easy is it to integrate a sortable/pageable list of data? Struts, Spring and WebWork can use tag libraries like the display tag, value list or data grid. Tapesty has contrib:Table. JSF has dataTable component that requires custom logic for sorting (let me know if this has changed).
  • Bookmarking and URLs: Struts, Spring and WebWork give you full URL control. Tapestry has ugly URLs. JSF does a POST for everything. Conclusion: first 3 play nicely with container-managed authentication. Tapestry doesn't (although there's a patch for pretty URLs). JSF is not friendly to bookmarking.
  • Validation: Struts and Spring MVC can use Commons Validation - a mature solution. I've heard it's architecture is ugly, but who cares - it works! WebWork uses OGNL which allows powerful expressions. Client-side support is new and maturing. Tapestry has robust validation w/ good messages out-of-the-box. JSF has ugly default error messages, but is the easiest to configure.
  • Testability: Struts you can use StrutsTestCase, which requires web.xml and struts-config.xml. WebWork and Spring allow easy testing with Mocks. Spring has a spring-mock.jar that can be used for mocking the Servlet API with any framework (it's not Spring-specific). Tapestry is impossible to test because page classes are abstract. The argument I've hard is "you don't need to test them b/c they're so simple." JSF page classes can be easily tested and actually look a lot like WebWork Actions (except they don't extend anything).
  • Success Messages: The easiest way to solve the duplicate-post problem is to redirect after doing a POST. Struts is the only framework that allows for success messages to live through a redirect. It's fairly easy to get i18n messages in a Struts Action. Spring has nothing "built-in" for success messages. Long classnames / method arguments make it kinda clunky to get messages. WebWork has the cleanest way to get messages using a simple "getText()" method. Both require a custom solution to make your messages live through a redirect. Tapestry requires you to throw an exception to redirect and it still doesn't redirect (I haven't solved the duplicate post problem with Tapestry). JSF requires lots of code to get a ResourceBundle, but you could use Spring's IoC to inject a "messageSource" bean, making it a lot easier. JSF requires a custom solution for messages to live past a redirect.
  • Spring Integration: Supported by all, sample apps have examples (quick slide).
  • Internationalization: JSTL's <fmt:message> tag makes it easy in all JSP-supporting frameworks. Too bad there's not a standard for getting bundles in controllers and setting messages. Struts, Spring and JSF encourage you to use one ResourceBundle for all messages while WebWork and Tapestry encourage separate files for each page/action. This strategy is probably better for large teams.
  • Page Decoration: I used to be a huge advocate of Tiles (using it since August 2001). SiteMesh is much easier to setup and use. Tiles can be used in Struts, Spring MVC and JSF. SiteMesh can be used with all 5 frameworks. In fact, the sample app uses the same SiteMesh setup for all w/o changing a thing. SiteMesh requires no maintenance, Tiles requires you add entries to tiles-config.xml whenever you add a new page.
  • Tools: Struts has lots of tools available for it and even frameworks built on top of it (i.e. Beehive's NetUI/PageFlow). Spring has Spring IDE which is really just an XML tool for validating your bean and their relationships. WebWork has none (that've been released), but it is on the roadmap. Tapestry has Spindle, which is great for code-level programmers. It doesn't do drag-n-drop, but it does validate relationships between files. JSF has lots - but all of them cost money and tend to hook into proprietary app servers.
  • Business/Marketing: Struts has lots of jobs and is well-known in the industry. A lot of enterprise applications are based on it. Spring is getting more press, but mostly because of the framework's other features. Knowing the rest of Spring is more valuable than Spring MVC. WebWork is gaining ground, but it's still virtually unheard of on job boards. If you do get gigs using WebWork, it's likely word-of-mouth and you'll probably be working with some pretty smart people. Often used with Spring and Hibernate. Tapestry needs more marketing - no one has heard of it, hence no jobs exist for it. JSF is quickly becoming the most popular. Want to stay employed? Learn JSF. The best reason: so you can back up your arguments on why you do/don't like it.

    Dice Job Count: Struts (1006), Spring (15 - not a very good name for searching, used "spring framework"), WebWork (14), Tapestry (9), JSF (147).

  • My Opinion: You have to come to the conference for that ;-). Slides should be posted following my presentation.
  • Resources: Link and such for downloads, frameworks and tools mentioned.

Comments, suggestions, like it/hate it? Let me know. I expect to send this in in a few hours - so you'd better be quick!

Posted in Java at Oct 15 2004, 12:02:03 PM MDT 22 Comments

I don't hate JSF

I'm still amazed by all the traffic and comments received by my experience with JSF. In some cases it feels like I insulted some of these guys wives or something. Here's some good quotes from the comments:

The less than positive experience is because Matt wants to write an app while asking a million questions all over mailing lists and not investing the time to learn.

I think you're too in love with struts to have a clear sight on what's going on.

Pick your poison and stop bad-mouthing others because you don't get.

I admit that I was a bit harsh on JSF in my post. Here's why. I developed 5 simple apps this summer, all doing the same thing with different frameworks: Struts, Spring MVC, WebWork, Tapestry and JSF. All of them hooked into the same backend, which was Spring+Hibernate. I had a learning curve to overcome with WebWork, Tapestry and JSF. I already knew Struts and Spring MVC, so those versions where easy to develop with. Of the three (WebWork, Tapestry and JSF), I was able to complete the JSF version the fastest. It took me a 1 1/2 days for WebWork, 3 days for Tapestry and 1 day for JSF. Or so I thought.

The JSF app was pretty close to being finished, but I was missing one thing - a sortable/pageable table. And I hadn't written the test for my page classes yet. This was Wednesday. I made a post late that night on how much I liked the JSF-Spring integration library. If you'll notice in this post, I mentioned that I got the displaytag to work too (almost). I found that I had to use an empty tag to pull the list of users from my page bean into the request, and then the displaytag could render the list. This was almost perfect, but the <h:commandLink> didn't work, so I had no way of editing a record from the table.

At this point, it all started to break down - and my frustration began. I was sooo close to completing this application and so far (even with the minor snags I'd hit) it was the easiest one to develop. Juergen left a comment stating that Spring's core now had a DelegatingVariableResolver in its core. So I figured I'd make my application more "pure" and use that instead of the JSF-Spring integration library. This was my first mistake. The DelegatingVariableResolver from Spring didn't work with Sun's RI and only worked with MyFaces. I figured it wouldn't be hard to switch (JSF is a standard, right?) - so I went to it the next day. I'd also heard that MyFaces had a sortable/pageable dataGrid - so the switch seemed like a good idea.

The first bump in the road was that while the DelegateVariableResolver worked, MyFaces reported an error. The Spring guys blamed MyFaces and MyFaces blamed Spring. Result: it's a bug that no one will fix. I spent a couple hours being a good open-source citizen by 1) trying to fix it and 2) reporting it. The second bumb in the road was that I had to change a few things that worked in the RI but didn't work in MyFaces (I forget what now). However, this wasn't so bad since it also fixed a couple of issues.

Next I tried to use MyFace's <x:dataTable> to replace the display tag. Since it had a sortHeader component, I figured this would be easy. It turns out this component requires you to implement custom logic in your page bean. Things might've changed since July, but I doubt it. Lastly, aftering getting everything to work, I went to work on writing a jWebUnit test to test it all. While doing so, I found that it was almost impossible to test my edit screen. With other frameworks, I could specify a URL with a record id and then proceed to change form fields and push buttons. With JSF, there was no easy way to determine the URL. The rendered UI used heavy JavaScript and when you clicked on a link in the dataTable, this called a JavaScript function. I have no problems with JavaScript and I think it's a great technology. However, the current UI testing frameworks I use (jWebUnit and Canoo WebTest) use the Rhino JavaScript library (js.jar) and it sucks at JavaScript. It reports errors where there are no errors - and hence, I tend to exclude the JAR and disable JavaScript support in my tests. If there was better JavaScript support in these testing frameworks - I'd likely have to problems with JSF's "I post for every link" mantra.

In most of my development life, I've most often been a framework user rather than a developer. This means that if I find problems, I don't extend the framework - I look for other solutions. Call me whatever you like, but I'm just trying to get my job done and the project completed. I don't want to mess with the internals of a framework to make that happen. With JSF (and Tapestry too), you have to be more of a framework developer. You have to be willing to create your own components. These frameworks are designed as component frameworks and they want you to extend them. That's one of the major points of their architecture.

So here I am again, posting about JSF - which will undoubtably get an incredible amount of hits just because it has "JSF" in the title. Why? Because you can't ignore JSF. Even if you don't want to develop with it - there's going to be tons of jobs that require JSF in the near future. In fact, there are already quite a few. Surprisingly enough, in my job search last month, I has a more opportunities for JSF (and WebWork suprisingly enough) than Struts. Finding a Tapestry gig - good luck. Of course, I'm a consultant, not an employee - so I don't often don't get to choose frameworks for companies.

I think JSF is an immature technology that will rapidly mature. I hope it does b/c it was fairly easy to develop with - there were merely some minor bugs in the two implementations. These can be fixed. In reality, I think we should all quit bashing on JSF and jump in to try and make it better. Rather than complaining, let's try to help.

I've done my part and applied to be on the JSF Expert Group. They probably won't let me in though - everyone seems to link I hate JSF. If I had my way, I'd scrap the sucker and make Tapestry the JSF standard. ;-)

Posted in Java at Oct 15 2004, 09:04:03 AM MDT 12 Comments

Rename Packages Tool for AppFuse

One of the steps recommended in AppFuse's QuickStart Guide is to rename your project's packages from "org.appfuse" to "com.company.appname". In the past this has been a real pain. I recommended using Eclipse, but this only worked for renaming the .java files themselves. It didn't catch all the package names in .xml and .properties files. Furthermore, it did nothing to change any references to "org/appfuse/model" or any other similar paths.

No longer folks. Ben Gill has developed a "rename packages" Ant task that'll zip through your AppFuse project and rename everything for you!

To use it, simply download it and view the README file to install and use. The source for this project is also available. This tool should work regardless of whether you've installed any options or not. Thanks Ben!

BTW, I should mention there will be an AppFuse 1.6.1. There have been a few bugs entered and fixed in 1.6 and I'd like to add support for Tomcat 5.5.3 (now in Cargo's SVN) and upgrade to XDoclet 1.2.2 (due for release soon). I'll probably wait until there's both Cargo and XDoclet have been released - in case some more bugs trickle in.

Posted in Java at Oct 13 2004, 11:09:12 AM MDT 1 Comment