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 "roller". 153 entries found.

You can also try this same search on Google.

Updated Presentations: Spring, AppFuse and Comparing Web Frameworks

As part of my trip to Norway last month, I had an opportunity to update many of the presentations I've delivered at JUG meetings and conferences. Of course, there's not a whole lot to these slides because I believe the real value is seeing them delivered. ;-)

The presentation on Test-Driven Development with Spring and Hibernate (a.k.a. AppFuse) will serve as the basis for my AppFuse Tutorial at OSCON. If you're planning on attending that tutorial and would like to see any enhancements, please let me know. All of these are downloadable in PDF format.

Enjoy!

NOTE: I updated this site to the latest code from Roller's CVS this morning, so please let me know if you see any issues.

Posted in Java at Jun 07 2005, 12:36:43 PM MDT 4 Comments

At the MySQL Conference in San Jose

I arrived in San Jose at 10:00 this morning to give a 3-hour tutorial on developing test-driven webapps with Spring and Hibernate [download PDF]. This was just a fancy name for developing webapps with AppFuse, but the session seemed to go over pretty well nevertheless. In the first half of the class, there were a couple of sleepers, but I cranked down the A/C for the second half and everyone stayed awake (although some were shivering). I never thought I could ramble on for 3-hours, but it wasn't that hard. I did end up doing mini-presentations on Spring and Comparing Web Frameworks, but all in all, I think it went pretty well. Very few people in the room had heard of any of the Java web frameworks, and only 6 were familiar with Spring and Hibernate. It was a tough crowd, but AppGen's code generation (hopefully) showed it's easy to create CRUD-based webapps with AppFuse. Note to self: make a video of that.

I have a free pass to the MySQL Conference, but I doubt I'll attend many sessions. I have a lot on my plate for AppFuse 1.8, Acegi integration into Roller, and some updates for Spring Live. It should be a good week, hopefully I'll get a lot done. This weekend should be awesome - Julie shows up on Friday for our 5-year anniversary party.

The best part of the conference so far? Talking shop over beers with the locals (crew from c|net and AppFuse user Phil Hershkowitz).

Posted in Java at Apr 18 2005, 09:34:01 PM MDT 1 Comment

Closures with CollectionUtils

Here's a pretty nifty trick for using closure's with Jakarta Commons CollectionUtils:

List list = new ArrayList();
...
CollectionUtils.forAllDo(list, new Closure() {
    public void execute(Object obj) {
    // execute something for each item obj
    }
});

I wonder if there's any performance hit from doing things this way vs. a good ol' Iterator? Hat tip to Anand Subramanian.

Posted in Java at Apr 13 2005, 08:49:07 AM MDT 18 Comments

Spring MVC vs. WebWork Smackdown at OSCON

Matthew Porter and I are going to try something a bit different at this year's OSCON. Rather than just getting up in front of the crowd and spewing our technical know-how, we're actually going to make a go at providing some entertainment. I've been to a lot of conferences and I'm tired of just watching someone talk - I'd rather see a good presenter over a knowledgeable presenter. This has inspired our OSCON 2005 talk:

This presentation has a unique delivery style. Rather than one person doing a comparison, there are two presenters - each which is an expert in the framework they're defending. The presentation is delivered as a friendly comparison/debate, which hopes to add some humor in to make it fun for the audience.

Java web developers often have a difficult choice when choosing a web framework these days. There are currently more than 35 open-source Java web frameworks available. How do you which one to use for your project? This presentation picks two of the most popular frameworks, Spring MVC and WebWork and compares and contrasts their features. Topics will include:

1. View options - i.e. Velocity, JSP, HTML Templates (ala XMLC), etc.
2. Testability - How easy is it to unit test with JUnit, with examples
3. Type conversion - i.e. Date, Integer, etc.
4. Validation - How do do it, stengths and weaknesses
5. Tools Support
6. Strengths and Weaknesses

Now the pressure's on - we have to both teach and entertain the audience. Please feel free to post your experiences with Spring or WebWork and why you think one is better than the other.

Posted in Java at Mar 09 2005, 09:31:36 AM MST 25 Comments

Rails is 8 times slower than Spring+Hibernate

Might as well start off this week by getting people's blood boiling. ;-) According to a comment on Dion's blog:

Having done extensive performance (scalability means different things to different people) testing on both Rails and a comparable Spring/Hibernate/JSP2 webapp (no one seems have have done any sort of benchmarking on Rails, or they simply don't care, I don't really know, but since benchmarking is what I do... :-)) I can say that Apache2/FastCGI/Rails is about... 8x slower than the comparable Tomcat/Spring/Hibernate/JSP2 solution. And that is with caching turned on in Rails (using Rails 0.9.5...)

Quite frankly, 62 req/s on a Dual Opteron with 4GB of RAM rendering a simple view with no DB access is too... damn slow.

Personally, I still think Rails looks like a great (and easy) way to develop webapps. I just wonder if there's some truth to the "can't scale" argument. I guess the best way to find out is for me to develop an application like AppFuse with Rails, and then hammer it (and AppFuse) with JMeter to see what kind of results I get.

On a sidenote, I wonder when Rails will hit the illustrious version 1.0? They released 0.1 last week - which is a bad version number for marketing. If it's as mature as folks claim, why not make the next release 1.0? That version number alone will likely allow developers to use it more in big companies.

Posted in Java at Feb 28 2005, 06:25:27 AM MST 15 Comments

Programmer Shirt

I received a great new shirt in the mail yesterday. It was from one of the ApacheCon organizers b/c re-imbursement got somewhat messed up. I guess it was some sort of apology. Here's what it says:

$> cd /pub
$> more beer

I dig it!

Posted in Java at Feb 11 2005, 05:29:04 AM MST 7 Comments

Java and Booze next Monday in Denver

Fellow Roller developer Lance is coming into Denver for a brief business trip next week. We're going to hook up for some dinner and drinks at CB Potts on Monday night at 6. If you want to talk about Roller, Java or authoring books - please join us. The more the merrier!

Posted in Java at Jan 06 2005, 11:24:26 AM MST 2 Comments

RE: J2EE App Server Security

Dion and Christian are talking about J2EE App Server Security. Specifically, they are talking about setting up standard container-managed security. J2EE allows you to specify security settings in your web.xml, but to make those work - you have to configure your app server. For Tomcat, this is pretty easy, and Resin makes it easy too. However, the XML you have to write for both is quite different and some app servers don't even let you write XML - instead you have to use their "admin console". Personally, I think most admin consoles are a pain in the ass. I'd prefer to write a single XML file to configure the server. Some servers require several files just to authenticate against a database.

AppFuse uses both container-managed authentication and a JNDI DataSource. This means you have to configure the appserver in order to run AppFuse. On many servers, this is difficult to do (or, they didn't pass my 10 minute test at least). I like servers where I can deploy a couple of JARs into a directory and a single XML file to configure the server. Tomcat and Resin come to mind.

After using Acegi for the last month, I think I'm going to ditch the "standard" J2EE security stuff. I managed to port AppFuse to use Acegi last month - and didn't have to change a single line of security-related code. The hardest parts of integrating Acegi where 1) figuring out how to build it from CVS (there's currently two src trees) and 2) excluding URLs. Once I got these two things solved, I had to add an "enabled" column to my user table, but that's about it. This is awesome b/c it means you can always port back to CMA with very few code changes.

I used to think that using the container's resources was a good thing, but I'm starting to change my mind. Spring allows you to configure a DataSource connection pool just like Tomcat does, so there's not as many benefits as there once was. Being able to drop a WAR into a directory and have your app work without configuring the server is a very nice thing. What do you think? Are there any advantages to using a container's services anymore? I suppose there is for distributed or clustered apps, but that's all I can think of.

Posted in Java at Jan 04 2005, 09:59:26 AM MST 17 Comments

Tuesday at ApacheCon

Tuesday at ApacheConIt's now Tuesday morning at ApacheCon and I'm proud to admit I've been pretty lame on the party front so far. It feels great though, I went to bed at 10:30 last night and slept until 9:30 this morning. I pretty much crashed after having such a hectic schedule the last couple of day.

On Saturday night, I was up until 4:00 a.m. cranking out Chapter 10 of Spring Live. I got back up at 7:30 and almost finished it by noon. At 1:00, I arrived at Denver's No Fluff Just Stuff, and moderated a BOF on Comparing Web Frameworks. Then at 2:00, I did a session on AppFuse. Following that, I spent 2 hours finishing up Chapter 10 and sent it off to for editing. 18 pages in 18 hours - oof.

After sending off my chapter, I headed home and had dinner with the family before heading to the airport at 7:00. We arrived in Vegas at 10:30 and went to the Hard Rock for beers. I didn't have any cash so I borrowed some from Jim. After 10 minutes of Blackjack, I was up $120, so I paid Jim back and called it a night. I got heckled as I left the Hard Rock at 3:00 a.m.

Yesterday (Monday), I woke up at 8:30 with a raging hangover. Damn wine chasers - don't seem to work for beer. Bruce didn't take any, got 3 hours of sleep and felt fine. My talk was at 11:00 and I managed to stifle the hangover about 5 minutes before it. The talk went well and the room was packed (approx. 100 folks). After the talk, I grabbed some lunch with Scott, Jim, Jonathan, Howard and his wife.

At 2:00, Dion interviewed me for TheServerSide. At 3:00, I had a meeting with the SourceBeat guys, and had some beers with Michael Koziarski around happy hour. Then I hit an ApacheCon sponsored free-beer thing and later headed to the "Pink Taco" with Jonathan and Dave. I could barely stay awake after dinner, so headed to bed early.

Today, I plan on attending a few sessions and possibly doing some gambling this evening. Sure is nice not having any commitments for the rest of the week. I have a few meetups with folks, but nothing that requires preparation.

Posted in Java at Nov 16 2004, 12:42:29 PM MST

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