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.

In Training

In Training

Abbie will be fetching beers for Daddy before long!

Posted in General at Aug 10 2004, 08:35:10 PM MDT 1 Comment

A new experience with Word

I just opened up Microsoft Word for the first time on XP with the 23". It showes two pages side-by-side. Page size? 100% Now that's cool! This didn't happen on OS X. This will definitely make writing and reviewing a lot easier.

Posted in General at Aug 10 2004, 05:24:00 PM MDT 4 Comments

Frustrating day with Linux

I can tell I've been getting a little burned out the last few days. I think it had a lot to do with our builder's death last week. I came to realize that working my ass off just doesn't have that many rewards. For most of the weekends this summer, I've been getting up at 4 and working for a few hours until Julie and Abbie get up. Then I do it again on Monday morning. This weekend I didn't get up before 9. And today I slept until 8 - even though I had planned to get up at 4. To make matters worse, rather than putting in hours for my client today, I spent the entire day wrestling with Linux.

I really wanted to get my new Cinema Display working with Suse and Fedora. I'm almost to the conclusion that it "ain't gonna happen". This sucks b/c now I have to leave one of my huge-n-heavy CRT monitors on my desk. Days like today, where I banged my head against the wall all day, are quite discouraging. My office is in turmoil - with open boxes all over the floor, monitors strewn about and video cards piling up on my desk. Some days are better than others. Hopefully my frustrations from today will turn into some type of writing zone later this week.

Update: I finally gave up and hooked my two Linux boxes up to my old KVM switch and a crappy ol' keyboard/mouse that I had lying around. Then I was planning on hooking my PowerBook and XP box up to my new DVI KVM switch. Wouldn't you know it - it doesn't fricken work. The connector on the cinema display is too fat to even plug into the KVM switch. My guess is that no one is using these displays with a KVM or maybe there's a special switch I have to get. Oh well, I guess I can manually switch the monitor b/w OS X and XP if I really need to.

Posted in General at Aug 09 2004, 10:38:28 PM MDT 11 Comments

David Geary - the JSF guy?

I wonder if this David Geary is the JSF Geary. I hope so, it'd be great if he started blogging. I've seen David speak before and he's definitely good. Regardless of my recent experience with JSF, it's a technology that's likely to succeed. David is a JSF expert - so hopefully he'll have some tips and tricks for us.

Posted in Java at Aug 08 2004, 02:31:54 PM MDT 4 Comments

Cinema Display on Linux

I received all the new hardware I need to hook my Windows XP and Fedora/Suse boxes up to the 23-incher. So I started to hook it up last night. Windows was easy. I did have to plug in a VGA monitor in order to install the Radeon 9600 LE drivers, but then everything just worked. As for Linux, that's a different story. I can't seem to download these drivers - it just doesn't work. I sent an e-mail to ATI Support, but that resulted in an auto-reply with this link that results in a bunch of links and suggestions, but no downloads. Anyone know where to get Linux drivers for a Radeon 9600 LE card?

2 minutes later: After posting this, I tried the download again. It worked this time. Figures. A kid's birthday party and a concert will likely keep me from tinkering again until tomorrow. Of course, there's a bug show tomorrow and a friend is throwing us a baby shower. Aahhh, living life is so much better than tinkering with technology.

Posted in Mac OS X at Aug 07 2004, 12:25:06 PM MDT 6 Comments

My JSF Experience

Of all the MVC Frameworks I've developed with in the last few weeks (Struts, Spring MVC, WebWork and Tapestry) - JSF was by far the worst. And it's not the implementations that are the problem, it's the spec itself (as far as I can tell). Plain and simple, it does not simplify web development.

I spent 3 days developing a simple JSF app - most of it which I had done in the first day. The last 2 days have been spent migrating to MyFaces and trying to find clean ways to do things. My perspective on JSF after this experience? Run away. Run far, far away. All of the above mentioned frameworks are MUCH superior to this technology. Let's get on with the things I learned.

  • MyFaces handles duplicate posts nicely. If you hit "reload" on your browser after saving a record, you get presented with an empty form rather than a duplicate record. I believe I got a duplicate record with Sun's RI.
  • The ability to specify an "action" attribute on a button (or a link) and them map that action to a page (in faces-config.xml) is pretty cool.
  • Every button or link clicked results in a form post. That's just wrong - why can't I have true links like the web is supposed to? So much for bookmarks.
  • Saving state on the client results in enormously long URLs and/or hidden fields.
  • JSF support is fairly non-existent. Unlike the other MVC frameworks, the MyFaces mailing list has hardly any traffic and the Sun forums aren't much better.
  • The MyFaces website seems to be down whenever I want to look something up on it, like right now.
  • I did find some CRUD examples, like this this one, but was disappointed to find that i18n is not considered for setting success messages. I ended up using the solution described in this post. 6 lines of code to set a success message - you've got to be kidding me! Most frameworks have a simple 1-2 liner.
  • Waiting for JSPs to compile the first time has surprisingly become painful after using Tapestry, Velocity and FreeMarker for the last 2 weeks.
  • Integration with Spring is fairly easy (code is in CVS), but MyFaces spits out an error when it shouldn't be.
  • Validation messages are ugly. For instance, when a required field isn't filled in, I get: "lastName": Value is required. I was able to override the default messages, but I was never able to use the label of the field (vs. the field's id).
  • The <h:messages> tag is practically worthless. Sure it's great for displaying messages (error and success), but that's about it. It has a "layout" attribute that doesn't even work in Sun's RI, and in MyFaces it just wraps a <span> with a <ul><li> or a <table>. Both of these layouts are useless b/c you can't set a css class on them. I ended up using "table" and having to set a generic CSS rule (width: 100%) in order to get the message/error bar to show across the top of my page. This tag also doesn't allow you to escape HTML.
  • The <h:dataTable> component is nothing like the displaytag. MyFaces claims to have a pageable/sortable component, but it requires custom logic/methods in your managed-bean. Yuck. I ended up using <h:dataTable>, which has neither sorting or paging. This is only because I couldn't get an <h:commandLink> working inside a displaytag column.
  • JSF-created apps are pretty much untestable. Managed-beans are testable, but the UI seems really difficult with jWebUnit and Canoo's WebTest. IMO, it should be possible to specify a URL to edit a record (i.e. editUser.html?id=2). With JSF and my master/detail app, the link to edit actually sets about 5 hidden form fields with JavaScript and then submits the form. I could probably figure the URL out, but it'd be ugly. Also, the MyFaces <h:dataTable> will not render an "id" attribute if you specify one. This is needed to verify tables and their data with jWebUnit.
  • When using "ant reload" to reload my application (using Tomcat's Ant Tasks), I kept encountering a ThreadDeath error. This seems to be specific to MyFaces as I never saw it with other frameworks or Sun's RI.

Like Tapestry, I felt like I was banging my head against the wall a fair amount. However, with Tapestry (and all the other frameworks), I was able to get exactly the behavior I wanted w/o too much work. I could produce clean and user-friendly error messages - (Tapestry already had clean required messages built in). I was able to write a jUnitWebTest to test all CRUD activities. With JSF, I was able to test one thing - adding a new record. I couldn't edit it b/c the JavaScript support (which I tend to not use) puked every time it encountered a JSF-generated JavaScript function.

My opinion after all of this? If you know Struts, Spring MVC and WebWork are fairly easy to learn. WebWork is simpler and elegant, but Spring MVC supports more view options out-of-the-box. Tapestry is cool, but you'll have to invest a lot of time into learning it and you'll probably get caught up in its cult and forever be claiming "Tapestry Rocks!" which can get annoying to your fellow developers. ;-) Finally, I can confirm that SiteMesh rocks - it worked for all the frameworks I used and I never had to change a single line of code.

Whatever you do, don't use JSF. Not yet anyway.

Posted in Java at Aug 06 2004, 04:53:22 PM MDT 76 Comments

RE: Friday People

Russ makes a good point. I used to be the kind of guy that would wake up on Friday's and love it. Friday was a great day to go to work. I rode my bike in, coded for a couple of hours, and then the whole team went out to "Friday Lunch" - where lots of laughs were shared and good beer was consumed. Now, I wake up and think, "Shit, it's Friday - I'm gonna have to work this weekend to get XXX done." Sometimes I wish I was a 9-5er again...

Posted in General at Aug 06 2004, 11:29:49 AM MDT 1 Comment

The Joy of developing with JSF

I plan to write up a "My JSF Experience" post later today, but first, I'm forced to rant on the state of JSF implementations. First of all, I must say that JSF isn't so bad. It's cool how you can map buttons to "actions" defined in a navigation entry, as well as to call a method in a managed bean. The problem that I'm experiencing is that the JSF implementations, both from Sun and MyFaces - are errrrr, not so good.

I actually managed to almost finish my simple JSF sample app in one day, but then decided to shoot off some questions to see if I could resolve some remaining issues. Then based on feedback I received, I decided to switch from Sun's RI to MyFaces - not only for the "sortable" grid (I still don't know if it exists), but also Spring supports it w/o using an add-on library.

Ever since I switched, things just haven't gone right. First of all, MyFaces, requires your implement a <listener> in web.xml - who knows why, but you get an error indicating you need it if you don't have it. Standard JSF doesn't require this - why does MyFaces?

OK, I can deal with adding the listener. Everything works as with Sun's RI - and even better since the "layout" attribute of <h:messages> actually works. BTW, why isn't "div" a choice instead of "table" - whoever designed these choices obviously still uses Netscape 4 and table-based layouts. I'm happy now. MyFaces seems to solve the duplicate post issue so if you refresh after adding a record, it just shows a blank form. Cool, I can live with that.

One problem I found, that likely exists in both implementations, is that it's a true pain-in-the-ass to get a declared ResourceBundle in a managed-bean. Here's the method I'm currently using to add a success message:

    public void addMessage(String key, String arg) {
        ApplicationFactory factory = (ApplicationFactory)
            FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
        String bundleName = factory.getApplication().getMessageBundle();
        ResourceBundle messages = ResourceBundle.getBundle(bundleName);
        MessageFormat form = new MessageFormat(messages.getString(key));

        String msg = form.format(new Object[]{arg});
        FacesContext.getCurrentInstance().addMessage(null, 
                new FacesMessage(FacesMessage.SEVERITY_INFO, msg, msg));
    }

There has to be an easier way! Please tell me there is. I admit that I'm a JSF rookie - having just started using it two days ago, but it seems ridiculous that all the "success message" examples out there don't even consider i18n.

So now I have my success messages working, but I discover that there's no way to escape HTML (using <h:messages>) from my ResourceBundle (to put bold around a part of the message). ALL of the other MVC frameworks I've been dealing with allow this - why doesn't JSF?! Again, I'm hoping someone tells me I'm ignorant and there is a way to do this.

Lastly, I tried to upgrade to the latest MyFaces snapshot from CVS to solve this bug and now I can't even get my fricken app to start up because of this issue. Are these the hoops that developers have to go through to get started with JSF? Thump, thump, thump. My head is starting to hurt.

Update: I'm an idiot about the "can't get my app to start thing" - I didn't copy all the new myfaces*.jar files into WEB-INF/lib. Heh. =P~

BTW, MyFaces requires a whole slew of JAR files just like Struts. Here's my current inventory:

  commons-codec-1.2.jar
  commons-collections-3.0.jar
  commons-digester-1.5.jar
  commons-validator.jar
  commons-oro.jar
  commons-logging.jar
  jstl.jar
  myfaces.jar
  myfaces-components.jar
  myfaces-jsf-api.jar

Posted in Java at Aug 06 2004, 10:35:05 AM MDT 4 Comments

Rock Bottom Brewery

This evening, I met up with Dion, Christian and Bruce at the Rock Bottom Brewery. Topics discussed: OSCON, JavaOne, WebSphere, AOP, JBoss, Geronimo, Spring, Struts, SourceBeat, OpenLogic, TSS, ThoughtWorks, Ant, Maven, Digital Globe (of course), staying up late, getting up early and writing. Good stuff - thanks gents.

Rock Bottom Brewery

Posted in General at Aug 05 2004, 11:43:27 PM MDT 1 Comment

3 days with the 23"

Because I didn't have a DVI Video card for my Windows or Linux boxes, I've been working all week on my PowerBook with my new kick-ass 23" monitor. I'm in love.

It's actually changed my whole perspective. The whole machine actually seems faster. I can see so much fricken' stuff on the screen that I never close anything anymore. The bad part? Now that I'm enjoying OS X so much, I can tell I'm going to have to buy a dual G5. Probably not this year (I have to pay off my monitor loan first), but it's definitely in my future.

Posted in Mac OS X at Aug 05 2004, 11:13:59 AM MDT 4 Comments