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 "matt". 1,142 entries found.

You can also try this same search on Google.

SiteMesh passed the 10 minute test

I decided to go out on a limb this evening and give SiteMesh a run for its money. The first warning sign was that the documentation refers to version 2.0.2, while the downloads section refers to version 2.0.1. So I proceeded to download 2.0.1. I promptly noticed that the install guide indicated I needed to download SiteMesh's two TLDs and configure them in my web.xml. Blech - this is so year 2000 - most modern containers support loading taglibs from JAR files with a URI.

So I did a good ol' cvs co of sitemesh from java.net. First of all, I'd like to say kudos to java.net and their CVS repositories - they've been rock solid for the few weeks I've used them. After checking out sitemesh, the first thing on my agenda was to give it the tried n' true ant test. This means I navigate to the sitemesh folder and simply type "ant". At this point, I should get one of two things - a BUILD SUCCESSFUL with a JAR or a help message telling me what I should type. I got the former, which I prefer.

After this, I integrated it into my app using the decorators documentation and deployed it. At first, I received the lovely ol' "getOutputStream() has already been called for this response" error, so I hacked PageFilter.java to use PrintWriter writer = response.getWriter(); instead of PrintWriter writer = new PrintWriter(response.getOutputStream());. Build, copy, package, deploy and voila - it all worked!! Wow that was easy. ;-)

Here's the weird part. I decided to reverse my hack on PageFilter.java to prove that I'd actually fixed the bug. Now I'm back to the original code I got from CVS and I can't get the getOuputStream() error to rear its ugly head. Doh!! This experience begs the following question.

Is SiteMesh stable enough on Tomcat 5 that I can should use it in my Spring Live sample app?

SiteMesh definitely passed my 10 minute test, we'll see if it holds up for the long haul. So far, I'm quite impressed with its easy configuration and quick implementation. I especially like that you can literally guess at it's syntax and you'll get it right. Maybe I was just lucky... heh

P.S. You should probably know I'm a big fan of Tiles. I wonder if SiteMesh will let me switch a decorator on the fly like Tiles does?

Posted in Java at Mar 24 2004, 12:07:56 AM MST 16 Comments

[Construction] Basement wall falls off

Our builder and I were in our front yard swapping lies this afternoon - when all of a sudden, the existing basement wall fell off! It didn't look like it was holding the house up at all, so I kinda just shrugged my shoulders and said "oh well." We're planning on moving out this weekend anyway. Bob (the builder) took a quick look and determined the wall (and former wall under it) was not holding the house up, so we both chalked it up to no big deal.

However, after a closer look - he determined it was an important wall and I should get out of the house. So now I'm at DU's Library. I don't think our house will cave in because the wall just fell off. Who knows though - it's kinda freaky walking around in a house that has a chance of collapsing. The 2nd picture below is kinda funny - he was going to prop the house up, but decided it wasn't gonna work. Hopefully, I can go home in a couple of hours and all will be patched up - so I can continue working there for the next couple of days.

basement Wall falls off
Basement wall falls off
Prop it Up
Propping it up ;-)

Posted in General at Mar 23 2004, 03:18:40 PM MST 2 Comments

Carpal Tunnel

When I finished hacking away on Roller this past Saturday, my fingers hurt from typing so much. Who knows why, I didn't add that much code. Must've been all the keystrokes to run Ant, start Tomcat, and test stuff. Yeah, we need more tests - but those won't help tweak CSS. Yesterday, all I did was review Hibernate in Action, so no coding, but a fair amount of typing. By the time I went on a bike ride yesterday afternoon - my left hand's left-most fingers were curled up naturally and my forearm was aching. Carpal Tunnel has set in quite nicely in my left forearm. I can still type, as evidenced by this post - but it definitely hurts and it seems like I could do some serious damage if I keep it up.

Herein lies the problem. I took this week off from my regular gig to concentrate on the Spring book. So I need to be typing like a madman all week - but my body is not cooperating. Rather, it's trying to tell me something - "you're not cut out for this this much coding/typing." So what should I do? I've had these same symptoms before - and when I did, I got a massage and took a couple of days off. That's a bit difficult this week with my livelihood depending on a pain-free left arm/wrist/fingers. I've booked a 10:00 massage - let's hope that gets me through the week. I definitely need a longer-term solution though. It'd be nice to write this book w/o typing, just talking.

Related: Carpal Tunnel in March 2006.

Posted in General at Mar 22 2004, 08:22:23 AM MST 13 Comments

A Day with Roller

I put a whole sh*tload of hours into Roller today - around 14 to be precise! My main goals where to get password encryption enabled and Remember Me re-implemented as a more secure feature. I managed to accomplish both and did so much typing in the process that my fingers hurt.

Other things I managed to accomplish:

  • Added ability to put a period (.) in a page name. Also modified BasePageServlet to set contentType appropriately for those "pages" ending in .xml, .js and .css. This should allow pages to be created for CSS and JavaScript, and then included in your pages with <link> and <script>.
  • Moved Calendar in Weblog editor to top right (was at bottom left) - making it easier to view and navigate to different days.
  • Fixed comments and spam stuff that Lance added.
  • Fixed pop-up Calendar on Weblog Edit screen to be properly positioned in IE and Mozilla.
  • Added up and down arrow buttons to allow expanding and contracting (taller and shorter) of weblog textarea. Persisted user's preference with a cookie.
  • Various UI enhancements to make the Editor UI look good in both IE and Mozilla (on Windows XP).

Phew - I'm ready for a beer! You can checkout our demo instance if you'd like to try out the latest code.

Posted in Roller at Mar 20 2004, 10:14:00 PM MST 24 Comments

No more Struts in services layer

Yesterday, I did some more refactoring on AppFuse and got rid of Struts in AppFuse's services layer. Basically, I was using business delegates (a.k.a. Managers) to convert POJOs -> ActionForms and vise versa. So now the question is - why do I even need Managers and why don't I just talk directly to DAOs (as most sample webapps do)? I think the best justification is that Managers can be used by rich client apps and it abstracts the DAO implementation a bit more.

The question is - is there any point to using Managers in a webapps that will always be webapps (no rich client)? To be honest, probably not - but it does make for easy testing of the business logic. The main reason I did a Struts-purge is to get ready for adding other MVC options - most of which allow me to use POJOs in my view. I'm looking forward to adding Spring and WebWork support and I'm willing to bet these solutions will be a bit cleaner. Unfortunately, neither of these frameworks offer client-side validation support, but the good news is it's coming.

The best part about yesterday's refactoring? I ended up deleting more code than I added - which is always a good thing.

Posted in Java at Mar 18 2004, 06:58:16 PM MST 16 Comments

One Year Ago - Wrox goes under

Pro JSP, Third EditionI was on vacation at my sister's when I found out. I'd just finished the final edits on my chapters and it was time to party. But then, one year ago today, I read (via weblogs) that Wrox was going under. Today, it's nice to look back and see that Pro JSP did get published.

You'd think after 6 months, we'd start to see some royalties. Nope. Nothing. Maybe it's not selling enough copies for the authors to get our $5/year cut. ;-)

Posted in Java at Mar 15 2004, 11:10:00 AM MST 10 Comments

[Struts Menu] Building Dynamic Menus from a database table

I spent a few hours this weekend and did some work on Struts Menu. At the very least, I made it easier to build dynamic menus programmatically and put together an example of doing it from a database table. I also added support for Expression Language (EL) syntax in all the tag's attributes. For the EL implementation, I simply copied what was implemented in the DisplayTag. I don't know that it's the best way (two TLDs, subclassing tag classes), but it works and it is good enough for now. The main reason I copied the implementation in the DisplayTag is that we've been talking about adding support for OGNL. I figure if I copy the implementation, it should be easy enough to copy the refactorying if/when it happens.

Back to the point of this post - how do you build dynamic menus? So without further ado, here's how to build and display database-driven menus with Struts Menu.

Posted in Java at Mar 14 2004, 04:53:33 PM MST 4 Comments

[DisplayTag] Changing a row's CSS class based on values in the row.

One request I've seen on the displaytag-user list a few times is the ability to change a <tr>'s CSS class based on a certain value. While the displaytag doesn't have this feature out-of-the-box, it is possible (and fairly easy) to do. All you need to do is sprinkle a little JavaScript into the mix. Basically, the displaytag will render a well-formed HTML table - like the following:

Username First Name Last Name
mraible Matt Raible
tomcat Tomcat User

By adding an "id" attribute to your table (i.e. id="user"), your table will get an "id" attribute and now you can easily access it via the DOM. The following JavaScript will grab the table and search the first column for a value of 'mraible' - and if found, it will change the row's background color to red.

<script type="text/javascript">
<!--
    var table = document.getElementById("user");    
    var tbody = table.getElementsByTagName("tbody")[0];
    var rows = tbody.getElementsByTagName("tr");
    // add event handlers so rows light up and are clickable
    for (i=0; i < rows.length; i++) {
        var value = rows[i].getElementsByTagName("td")[0].firstChild.nodeValue;
        if (value == 'mraible') {
            rows[i].style.backgroundColor = "red";
        }
    }
//-->
</script>

You could easily change rows[i].style... to rows[i].className = if you want to assign a new CSS class. Now let's see it in action (and see if your browser supports it). This has only been tested in Safari and Mozilla on OS X.

Username First Name Last Name
mraible Matt Raible
tomcat Tomcat User

Other displaytag tips: Static Headers HowTo and Highlight and allow clicking of rows. The 2nd tip (highlighting) is available in AppFuse, in the userList.jsp page.

BTW, I also added support for the DisplayTag to render the results from JSTL's SQL Tag. I haven't committed it yet - I'm still waiting for more feedback.

Posted in Java at Mar 08 2004, 01:22:34 PM MST 10 Comments

Great CSS Designs

While reading the latest issue of A List Apart this morning, I got sidetracked and visited the CSS Zen Garden, finally landing on David Shea's blog. There I found his listing of Great CSS Designs. There's some very nice sites in there.

In other news, today is one of those days that sucks to work from home. I can see the snow falling out my window, and it's snowed almost 2 feet in the last 48 hours at Vail, Breckenridge and Winter Park. Urgghh, the slopes are calling, but so is my pocketbook. Note to self: get your priorities straight next year so this doesn't happen again. This is the first year in the past 5 that I haven't bought a ski pass and I won't do it again. Oh well, at least it'll be a good night for a hockey game.

Posted in The Web at Mar 05 2004, 07:45:05 AM MST 3 Comments

AppFuse 1.4 Released!

This release involves many changes: re-arranging packages/directories, Spring integration, Remember Me refactorings and I also added iBATIS as a persistence option. I also spent a lot of time going through the tutorials to make sure they are up to date. I've been using AppFuse 1.4 for a few weeks on my current project, and I really do like the way Spring makes it easy to configure Hibernate, Transactions and Interface->Implementation relationships. If you're interested in upgrading your AppFuse 1.x app to use Spring, you can checkout this howto.

I also made the leap and moved the AppFuse project from SourceForge to java.net. This is mainly so I have more control over mailing lists and adding other developers. As of today, CVS files in SourceForge and Java.net are the same - but I'll only be updating Java.net from here on out. I also have released files in both projects, but will only use java.net in the future.

I spent all weekend updating the tutorials and fixing release-related issues. Phew - I'm glad that's over. "So," you ask, "what's next?"

A week of vacation (my sister flies in tomorrow), followed by starting to write Spring Live and creating a Spring MVC option for AppFuse. Oh yeah, I'll also be at SD West in Santa Clara, CA - let me know if you plan on attending.

Posted in Java at Mar 01 2004, 12:35:54 AM MST 11 Comments