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.

Raible Road Trip #8

I'm heading to the airport w/in the next hour to embark upon Raible Road Trip #8. My dad is meeting me in San Diego tonight and we're picking up my new bus tomorrow morning. From there, we're going to pick up a few supplies, get the oil changed and head out on the road. I'm taking our digital camera so I'll try to take lots of pictures. We have ideas for the route (maybe through Flagstaff?), but nothing is for sure. Our main goal is to avoid the heat since the bus has an aircooled engine. Our secondary goal is to make it back to Denver by Tuesday so my Dad can catch his flight back to Oregon. A side effect of all of this will be some good memories and hopefully a good story or two.

Posted in General at Jun 03 2004, 02:05:25 PM MDT 2 Comments

Using JAAS with Tomcat

Want to use JAAS with Tomcat? If so, you might want to checkout this Using Tomcat with JAAS tutorial.

Although it is possible to use JAAS within Tomcat as an authentication mechanism (JAASRealm), the flexibility of the JAAS framework is lost once the user is authenticated. This is because the principals are used to denote the concepts of "user" and "role", and are no longer available in the security context in which the webapp is executed. The result of the authentication is available only through request.getRemoteUser() and request.isUserInRole().

This reduces the JAAS framework for authorization purposes to a simple user/role system that loses its connection with the Java Security Policy. This tutorial's purpose is to put a full-blown JAAS authorisation implementation in place, using a few tricks to deal with some of Tomcat's idiosyncrasies.

Personally, request.isUserInRole() usually does everything I need. If I need something more than that, it's usually pretty easy to add some custom logic. Of course, if I ever need anything super robust, I'll probably use the Acegi Security System for Spring.

Posted in Java at Jun 03 2004, 10:30:27 AM MDT 3 Comments

How do you make your source tree Eclipse/JUnit friendly?

I've never had a problem getting builds and unit tests to work with Ant. However, unit tests run faster in an IDE, so I'm trying to refactor some code to allow for testing in the IDE. My current directory structure looks like this:

-- project
   - web
     - WEB-INF
       - classes

I need both "WEB-INF" and "WEB-INF/classes" in my classpath. There's XML files under WEB-INF for Spring and Commons Validator, and there's a log4j.xml under WEB-INF/classes for log4j. These files are all in their natural locations as far as all the projects I've seen. However, Eclipse won't allow me to nest classpaths - so it's virtually impossible (as far as I know) to add both directories to my classpath. Any ideas how to workaround this Eclipse "feature" are appreciated.

For those "IDEA is better" folks - I agree. IDEA allows me to add web, web/WEB-INF and web/WEB-INF/classes to my classpath with no issues.

Posted in Java at Jun 02 2004, 12:46:10 AM MDT 6 Comments

Technical Confidence vs. Fitness Confidence

It figures, just as I'm about to do a major push to get some writing done on Spring Live, I wake up with a cold. It was bound to happen since Abbie and Julie are already in the midst of it. For some reason, I thought I could avoid it.

Three years ago, as I was entering into independent consulting, I could've avoided it. Back then, I was in shape and riding my bike all the time. When I first started as an independent, I had no time to exercise, but I was in such good shape that it took me well over a month to start gaining any weight. That summer was awful - I had no time to exercise and the commute was around an hour. But the pay was awesome and the technology was even cooler. It was summer 2001 and because of my new contract, I was learning all about JUnit, Ant, TDD and Struts.

Reflecting back on that summer, and the past couple of years, I seem to go through various levels of "confidence." There are two extremes for me, and I tend to reside in one or the other. The first is "technical confidence" and the second is "fitness confidence." When I'm coding like a madman, learning new stuff, and deploying release - I'm very technically confident. I don't feel like I need to learn anything new. I feel like I'm on the right track, and I'm generally pretty happy. This is, until I leave the computer. When I start interacting with my family and friends, I start to realize how out of shape I am. In order to get things done, I tend to give up exercising. Part of it is because its easy to give up, and sometimes I just feel guilty leaving Julie to run off and exercise - especially when she's pregnant with a sick kid in her arms.

In order for me to get in shape, it takes quite a bit. In the past when I've been in shape, I usually ride my bike 6 days a week. This is a time consuming effort, averaging about 2 hours per day. However, after I've done this for about a month, my "fitness confidence" starts to rise and I really enjoy being outside or working out. The downside is that when I find time to sit down at the computer, I see a flurry of e-mail and blogs about cool new technologies. My technical confidence plummets.

It's weird. I wish I could find a balance. I wish I had more drive to improve my fitness confidence right now. Unfortunately, many deadlines are looming and I need to sit here in front of the computer to get them done. I definitely need to turn this around. Health is one of the most important things in the world, and I'm so out of shape its pathetic.

Posted in General at Jun 01 2004, 03:01:08 PM MDT 8 Comments

The Java Community - its strength is in its disunity

Charles responds (in a comment) to Ted's accusation that .NET's community is better than Java's.

Actually, the strength of the Java community lies in its disunity. Unity is a false strength: it's safety in numbers, but it's also a herd mentality. I suspect the drive for "strength in unity" is a reflection of Microsoft's philosophy of dominance: that the best thing for the world is if everyone just Does Things Our Way: A computer on every desk running Microsoft software. The Java community has competing infrastructure vendors. We have a raft of competing web frameworks, competing AOP frameworks, competing persistence frameworks, competing IDEs, competing heavyweight and lightweight containers. And it's this competition that makes Java such a vibrant community. Nobody's quite satisfied with what the other guy's doing: everyone wants to do better. It's also what makes us, at times, a bunch of bickering children. That does us quite a bit of harm, but I think in the long run things work out for the best.

Well said.

Posted in Java at May 31 2004, 12:04:14 PM MDT 2 Comments

Testing Wiki Syntax and RSS Feed

If I use wiki syntax in this entry, will it show up property in the RSS Feed? I'd better put some wiki syntax in, like a link to AppFuse, Downloads and an external link. What about the Java2HtmlPlugin, does that work?

    public ModelAndView handleRequest(HttpServletRequest request,
                                      HttpServletResponse response)
    throws Exception {
        if (log.isDebugEnabled()) {
            log.debug("entering 'handleRequest' method...");
        }

        return new ModelAndView("userList", Constants.USER_LIST,
                                mgr.getUsers(new User()));
    }

BTW, I really like the new editor layout - nice job Dave.

Update: It looks like the Wiki Plugin isn't working. I tried updating my "_entry" page with no avail. Below are the contents of this file. I used to have $wikiPlugin.render($wikiText), maybe that's the problem?

Update 2: Duh, the JSPWiki Plugin wasn't enabled in web.xml. As soon as I enabled that, and dropped the Java2HtmlPlugin JAR into WEB-INF/lib, everything worked as expected. Strangely enough, it seems I shouldn't start my entries with !, but rather just check the JSPWiki Syntax plugin. I'm guessing the exclamation point check in my _entry page is still needed for backwards compatibility.

Posted in Roller at May 30 2004, 01:31:10 PM MDT 7 Comments

The Last Day

Today is my last day at my current client. It's been a great experience and the last couple of weeks have been particularly enjoyable. We demoed the app I've been building (a Job Posting/Resume Builder) this week and everyone loved it. It's now ready to go into production, so hopefully the "new guy" won't have to do much work. It's unfortunate that it couldn't go into production sooner - but they want to deploy on WebSphere instead of Tomcat, so they'll have to figure that out first.

I was originally scheduled to dive head-first into open source at EJB Solutions next week, but managed to wiggle my way into a week off. I was already planning on taking the 2nd week of June off to work on Spring Live - and now I get 2 weeks! I'm pumped to have two weeks off - too bad I have work to do. Oh well, I expect to work crazy hours and burn the midnight oil a lot. That way, I can spend the days playing with Abbie and giving Julie some much needed rest.

The best part? On Thursday, I'm flying out to San Diego to pick up my new VW Bus. My dad is going to meet me there and we'll be embarking on Raible Road Trip #8 to drive it back to Denver. This weekend I'm going to stock a toolbox to deal with any breakdowns along the way. It should be a good time - I love road trips. So if you don't hear much from me for the next couple of weeks, I'm probably writing or enjoying beers on the patio. ;-)

Mmmm, beeerrrr - have a good holiday weekend y'all!

Posted in General at May 28 2004, 01:18:46 PM MDT 7 Comments

[ANN] AppFuse 1.5 Released!

I finally found time to fix a few minor bugs in AppFuse 1.5 Beta and update all the tutorials. Now there's 3 new HowTos for developing a Master/Detail page using Spring's MVC Framework. After writing the tutorials, I found a new appreciation for Spring's MVC. I really like its lifecycle and (if given the opportunity) I think I'll use it for my next project. Without further ado, here's the relevant links:

Enjoy!

BTW, if you live in Colorado and you want to learn more about AppFuse, Spring and AppFuse Light - stop by the Denver JUG on June 9th or the Boulder JUG on June 10th. I'll be talking at both events. As a teaser, here's the bullet points from my slide on AppFuse Light:

  • Designed for quick apps with few requirements (i.e. prototypes)
  • Uses Sitemesh for skinning
  • No build-time dependencies (i.e. XDoclet), no out-of-the-box security
  • Web tests do not depend on container
  • All code can be easily ported to AppFuse if you need AppFuse features (i.e. security, i18n, gzip compression)
  • Simpler, lighter, faster (for building and testing)

Posted in Java at May 27 2004, 04:18:08 AM MDT 8 Comments

[NFJS Denver] Ramnivas Ladded and Aspect Oriented Programming

For the 2nd session of the day, I've decided to attend the session on AOP. My choices were Converting XML (Ben Galbraith), JSF (David Geary), What's new in EJB 2.1 (Monson-Haefel) and Runtime Code Generation (Glenn Vanderburg). I asked David about his JSF presentation and he said it was "boring" so I decided to skip it. This session, in the first 10 minutes, is pretty boring too. I might have to duck out of this and attend another session - but none of the other sessions really interest me. This one started this morning, and it seems to be a continuation of this morning session. It's mostly on AspectJ and he's doing the good ol' logging example. I don't really have an interest in using AspectJ since Spring's AOP is more than adequate for my needs. Oh well, I guess I'll stick around and relax.

Ramnivas is using Eclipse to compile his aspects, and shows us how if he uses "javac" to compile everything, no aspects are added. I'm guessing that there's some sort of plugin for Eclipse that allows for easy compiling of aspects. A new feature in AspectJ 1.2 is the ability to set an ASPECTPATH and then use "aj" rather than "java" to run code. This achieves the same effect as compiling the aspects in Eclipse. The "aj" script appears to just set the system classloader.

Now Ramnivas is showing us how you can use an aspect to define pointcuts on internal appserver classes. His example involves WebLogic, the J2EE Petstore and logging any EJB method calls. To use this, he has to start WebLogic with a custom script, that has a custom classloader defined. For some reason, we're now talking about log.debug() vs. if (log.isDebugEnabled()) { log.debug() }. Ramnivas thinks that most folks don't wrap their debug statements (the proper way). Who doesn't know about this?! I'd like to think that most developers are writing the 3-line version vs. the 1-line version.

An interesting quote: "So many things to show you - 3 hours is not enough." Maybe if we didn't have to wait 2 minutes for WebLogic to start each time, 3 hours would be plenty. ;-) Ramnivas just added logging to all the classes in the blueprints packages and then reloaded the page. There looks to be several thousand method calls occurring behind the scenes for a simple page. Of course, there's lots of tag libraries - but still - PetStore is a ridiculously complex application. Why did some ever impose this crap upon us as "best practices" for Java. IMO, best practices should be based around simplicity, maintainability, testability and performance. Does the PetStore even ship with unit tests? I'll bet it doesn't...

Now we're watching a pretty cool demo where Ramnivas is using aspects to enforce coding policies. In this example, he's using aspects to enforce rules in EJBs (i.e. no static variables, swing or threads). It interesting in that the aspects actually prevent compilation and display errors defined in the aspect. It's a neat idea, but I'm suspicious in that a lot of this AspectJ stuff seems to be Eclipse-specific. What I mean by this is that Eclipse seems to be required for compilation. Is it easy to aspect-enhance your classes using Ant? I would hope so.

Ramnivas seems to be quite the AspectJ expert. He mentioned that he wrote a book for Manning and has mentioned a couple of his contributions to AspectJ in this presentation. I admire authors that write and contribute to projects at the same time. It's often an indicator that the person knows what the hell they're talking about.

This afternoon's first session choices are as follows: JSF Advanced Topics (Geary), Intro to J2EE Web Services (Monson-Haefel), JSR166 (Glenn Vanderburg), Rhythm (Brian Boelsterli) and GUI Development (Ben Galbraith). Web Services and Rhythm are 3 hour presentations, so I might stay away from those - that's just too long for me. Now that I'm sitting in the 2nd half of a 3 hour presentation - it seems that these sessions are best attended in the first half. It's almost as if the presenter is trying to find things to talk about in the second half. Or maybe AOP is just a boring-ass topic. ;-)

I'd like to go to Brian's talk on Rhythm, since he's a good friend and mentor of mine. But then again, I learned Rhythm from him - and use it daily - so I don't know that I'd get anything out of it. Advanced JSF looks good, maybe I'll go to that one. For the 2nd session this afternoon, I'll probably attend Howard's Creating Powerful Web Forms with Tapestry. Maybe I should stick with JSF and Tapestry and make it a web-intensive afternoon. Both presentations are even in the same room!

Posted in Java at May 22 2004, 12:29:31 PM MDT 4 Comments

[NFJS Denver] Richard Monson-Haefel and Groovy Programming

Groovy makes for easier for loops. As an example,

for (Iterator i = r.iterator(); i.hasNext();) {
    System.out.println(i.next());
}

... becomes ...

for (i in r) {
  System.out.println(i)
}

With Groovy, you can remove semi-colons and use dynamic typing. This means you can basically remove any types (i.e. List). The nice thing is that typing is a choice - you can use static typing like you do in Java write now.

One thing I forgot to mention about this conference. Jay Zimmerman (the organizer) has a pretty good idea. The full schedule is printed on the back of the conference badges attendees hang around their necks. This makes it very easy to find and decide what session to attend. I wish more conferences would do this.

Richard is going through closures, native list looping and how you can remove classes and method declarations. It seems to me that one of the coolest features of groovy is that all of the shortcuts are optional. This is huge IMO, because it means the developer has a choice - which is always nice. Richard says that in his experience, a program written in Groovy is about 1/5 the size of the same thing written in Java (an 80% reduction in code). Someone in the room asked about performance. I was surprised to hear Richard say that Groovy was a bit slower. After asking about this, it turns out that Groovy can be executed as a script or as native bytecode (if compiled first). So when Richard said "it's slower" - he meant the script version is slower - because it's interpreted - just like any scripting language.

Sweet - I just got a connection on the hotel's wireless network. I was in the midst of reading some RSS feeds in NetNewsWire and noticed a JRoller blog with additional coverage of this conference. ... Sorry, I got sidetracked for the last 20 minutes with the Spring developer's mailing list - talking about simplifying Spring forms in JSPs.

Back to Groovy. Richard, and several members of the audience, are talking about closures. I still don't really get what they are and why they're important. I guess I shoulda been paying attention. ;-)

Groovy has regular expressions built-in - based on JDK 1.4 Regex. In Groovy, == is the same as .equals() in Java. And === is equal to == in Java. Apparently, they did this because folks usually use == when they really want to get the functionality of .equals(). I like the idea that == in Groovy means the same thing as == in JavaScript, but I don't know how I feel about ===. I'm guessing that using .equals() is still possible.

Richard has a good presentation style. He does a lot of coding during his presentation - writing scripting, compiling and executing them. Unfortunately, since I got internet access, I haven't been paying attention as much as I should - but at least 75% of the class seems to be extremely engaged. An interesting thing about this conference vs. the MySQL Conference in Orlando. At MySQL, almost all the presenters had PC Laptops. In fact, I was one of the only ones with a PowerBook. At this conference, Bruce Tate is the first one I've seen that uses a PC. Almost all the presenters are using PowerBooks - mostly 15".

Groovy can be used for easily writing XML as well as enhancing your Ant build scripts. One thing I'm hearing at this conference, as well as seeing on blogs recently is that AppFuse's build.xml could probably use some refactoring. With Ant's new import feature and the ability to write scripts in build.xml - it's likely it could be greatly simplified. Then again, it ain't broke - so why should I fix it?

Richard's showing us how easy it is to write XML using Groovy's shell:

import groovy.xml.*;

x = new MarkupBuilder();
a = x.Envelope { Body("Hi")}

If you run this, you'll get:

<Envelope>
  <Body>Hi</Body>
</Envelope>

An interesting thing from the above demo. When Richard added "print a" as the last line in the script, it printed "Envelope" after the XML output. He said this is because the last line in Groovy is treated as the script output. That's kinda wierd IMO. GroovySQL - pretty cool and simplistic. A nice feature is that connections are automatically closed (when the script completes). Another thing Richard mentioned is that Files are also automatically closed - even when used inside an Iterator. It seems to me that Groovy is trying to stop many newbie Java developer mistakes, as well as do more automatic resource management (closing files and connection). This is actually similar to Spring in how its JDBC and ORM support manages closing connections behind the scenes. Good stuff - another tool to make life easier for Java Developers.

Posted in Java at May 22 2004, 10:34:13 AM MDT 7 Comments