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.

Being an independent sucks

Richard Monson-Haefel seems to hate being an independent consultant. Personally, I love it - but I've only been doing it for 3 years. He's been independent for 5. I hope when my 5 year anniversary rolls around - I'm not looking for a full-time gig. But you never know. One of the things that I see a lot of independent consultants doing wrong is traveling. Traveling sucks - plain and simple. Being away from your family in the name of a higher hourly rate seems stupid. Then again, I've been fortunate enough to always find work in Denver - half of it where I'm working from home. I do realize that a lot of independents don't live in a tech-rich town like Denver, but why don't you move! Actually, the only reason we're still in Denver over West Palm or San Diego is because the contracts keep flowing. If they dry up - yeah, we'll probably be moving closer to the ocean. But if we move and I'm traveling for gigs - what's the point? I guess Julie's happiness (she loves the ocean) plays a part, eh? ;-)

I traveled a lot in March and April, but I don't plan on doing too many more stints like that. I guess June-July might be a bit rough with JavaOne and OsCon, but after that - I hope to stay put. We'll see - let's hope I get lucky enough to continue finding local contracts.

Posted in General at May 06 2004, 05:39:01 PM MDT 4 Comments

Glad I'm not in Vegas

Posts like this make me glad I'm not in Vegas for the TheServerSide Symposium. Sure it'd be fun to see a bunch of great speakers and hang out some smart folks - but the lack of sleep would kill a lot of that enthusiasm. I think Vegas is a great place for a bachelor party but not for a conference. At a bachelor party, you're expected to be a vegetable the next day - but at a conference...

To make matters worse, I'd be the guy that was up until 8 a.m. gambling and boozing like a madman. Glad I'm not in Vegas - I'd be like a kid in a candy store.

The real reason I'm not in Vegas? My mom is flying in tonight for the weekend. It is Mother's Day weekend after all.

FYI: Blogs covering the Symposium.

Posted in General at May 06 2004, 09:05:53 AM MDT Add a Comment

Struts Contract position in DTC

If you're an independent contractor, live in Denver, and know Struts - you might want to checkout this position. Requires: Struts, Tiles, JavaScript, DHTML. Sounds like a fun gig - contact me if you're interested and I'll give you the rate.

In a related note, I might have a contract opportunity for a local developer familiar with AppFuse and its technologies (most important: Struts, Hibernate, Spring and JUnit).

Posted in Java at May 05 2004, 09:11:46 AM MDT Add a Comment

You know you've made it when...

You know you've made it when you've been biled! Sweet - thanks Hani!

Matt "Proud to be an Asshat" Raible

Posted in Java at May 05 2004, 07:00:09 AM MDT 2 Comments

[ANN] AppFuse 1.5 Beta Released!

This release has lots of modifications that I've been meaning to make for quite some time. Specifically (1) removing the dependency on j2ee.jar and (2) removing Struts from the services layer. I also made improvements to Spring and its context file loading so you should be able to run unit tests from your IDE.

Other notables include full i18n support (with translations in Dutch, Brazilian and Chinese), improved setup-tomcat target (no additional JARs needed now), and an option to use Spring's MVC framework instead of Struts. If you'd like, you can read more about my conversion from Struts to Spring. Enjoy!

BTW, this upload was a little hefty for java.net at 12.5 MB - because of the iBATIS and Spring MVC option. My browsers (Mozilla and IE) kept timing out and I was getting a "Not enough space" error. To fix this, I had to increase the timeout on Mozilla. Here's the steps I went through:

  • Type "about:config" in the address bar.
  • Type "timeout" in the filter field and hit Enter.
  • Change "network.http.keep-alive.timeout" to 600 (10 minutes). The default is 300.

Posted in Java at May 04 2004, 03:57:41 PM MDT 10 Comments

Sucking off my bandwidth

While digging through my stats today, I found a site that's sucking off my bandwidth: http://laptops.inreview.com. Not only are they using one of my pictures from this post, but they're simply linking to my site - rather than copying the image locally. Those bastards! ;-)

I've sent them an e-mail, let's hope they have the courtesy to remove my image. I wonder how many other images of mine are being used on the web? I realize that if I put up an image on this site, it's likely to be copied and used on another site. I don't really care so much about that - but I would appreciate an e-mail asking permission, as well as the decency to copy the image to your local server.

Posted in The Web at May 03 2004, 03:23:32 PM MDT 50 Comments

Creating column indexes with Hibernate

One of the best ways to speed up your application's performance is to create or optimize indexes in your database. On my current project, when we created our database on the AS/400 last week, the DBA noticed that there weren't any indexed created. I expected this and said I'd do some research on creating indexes with Hibernate. Thanks to Gavin, it turns out to be quite simple. Let's say you have an XDoclet tag on a column you want to index. Currently it is:

@hibernate.property column="username" not-null="true"

If you're using Hibernate's <schemaexport> task, you can add an index on this column to your mapping file and it'll create the index when creating the database. To add an index, it's as simple as changing the above XDoclet tag to:

@hibernate.property
@hibernate.column name="username" not-null="true" index="index_name"

Now the hard part comes. Which columns should you put indexes on? From what I've heard, it's the ones that you use in where clauses of your queries. I expect one or two per table is sufficient (??). One thing I'm not sure of is: should id columns contain an index?

Posted in Java at May 03 2004, 12:06:44 PM MDT 11 Comments

Mapping buttons to methods

In AppFuse, I use Struts' LookupDispatchAction to map submit buttons to methods in my Actions. It's caused quite a headache for i18n, but Jaap provided a workaround and now everything works fine. However, as I did the Spring MVC implementation this weekend, I didn't have to do any complicated "button value -> method name" mapping. Part of it was because I didn't need to, but also because I discovered that you can easily just check if the button's name was passed in. Explaining this with code is probably easier. Let's say you have three buttons on a page:

The HTML code for the above buttons is:

<input type="submit" name="save" value="Save" />
<input type="submit" name="delete" value="Delete" />
<input type="submit" name="cancel" value="Cancel" />

Using the name as your key, you can easily check in your Action/Controller/etc. to see which button was clicked:

if (request.getParameter("save") != null) { 
    // do something
}

The nice thing about this is that it doesn't care what value you put on your button - just what you name it. It seems like all frameworks should use something like this, rather than a single parameter name (i.e. "method") that requires JavaScript on a button to change the method invoked. About a month ago, Rick Hightower mentioned that he uses a ButtonNameDispatcher for Struts. Rick, if you're reading this - I'm ready for that bad boy!

Posted in Java at May 03 2004, 09:27:52 AM MDT 12 Comments

Converting AppFuse to use Spring for MVC

It's been a long and painful week - with 3 or 4 nights where I was up to 4 or 5 in the morning. Last night I was up until 4:30 and Abbie woke me up promptly at 7:30. Ugh, sleeping more is probably a good idea. I started on the Spring MVC layer for AppFuse on Thursday night and it took me almost 2 days to convert everything. There's still a few kinks and workarounds - but if you're running it through a browser, everything works the same as it did with the Struts version. The hardest part about it was writing the unit tests. With Struts, it's rather easy b/c I use StrutsTestCase, which provides a very simple API for testing Actions. I'm sure Spring will soon have this same capability with its Servlet API Mocks, but I was definitely banging my head against the wall a few times. I did manage to convert the LabelTag to recognize required fields and error messages. The JSP conversion was a slight pain - but mostly because you have to type a lot more for input fields than you do for Struts. I'm looking forward to WebWork which requires one line to do the whole table row. It has Velocity templates for its tags and they write the <tr>, <label> and the <input>. Pretty slick IMO - less typing is always attractive to me.

I'd like to write-up a detailed entry on "migrating from Struts to Spring" on JRoller, but it's been flakey over there for a few days now - so I might just do it here. We'll see - the lack of sleep is draining my motivation to write. I hope to do the Ant-based installation for Spring in the next couple of days - then I'll release 1.5 beta. My main reason for the beta is because the Spring stuff can probably be cleaned up a lot, as well as it gives me time to write documentation before the final release.

Posted in Java at May 02 2004, 09:17:54 AM MDT 5 Comments

Populate your drop-downs with listeners and allow for refreshing

Most webapps have drop-downs (a.k.a. pick lists) that users select from when filling in forms. Spring has a nice referenceData method on its Controllers that you can use to populate these, but I prefer a different way. In AppFuse, I populate these using a ServletContextListener. However, one of the problems with using this is that your drop-downs won't get refreshed unless you have admins screens or a way to reload the attributes set in the listener.

In short, I think it's a good idea to load drop-down options in a listener and also have an action or servlet to refresh these options. For examples, see StartupListener.java and ReloadAction.java. Got a better way? I'm interested...

Posted in Java at Apr 29 2004, 04:50:55 PM MDT 4 Comments