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.

[ANNOUNCE] Commons EL 1.0 Released!

The Jakarta Commons Team is pleased to announce the first official release of Commons EL from the Apache Software Foundation. Commons EL provides an interpreter for the Expression Language that is part of the JavaServer Pages(TM) specification, version 2.0.

For more details see the release notes.

Source and binary distributions are available from the mirrors. Please remember to verify the signatures of the distribution using the keys found on the main apache site when downloading from a mirror.

For more information on Commons EL, see the EL web site.

Hmmm, I wonder if this means we can add EL support to the display tag library without including JSTL?

Posted in General at Jun 19 2003, 09:52:21 PM MDT 2 Comments

Using Struts' Declared Exceptions

With a little prodding from Erik Hatcher today, I took another look at Struts' Declared Exceptions feature. At the end of last year, I was wishing I could use declared exceptions to do chained exceptions for my Action classes. Basically, in each of my Actions, I have a try/catch wrapped around a call to the Business Delegate (example: UserAction.java). You'll notice that all the CRUD methods have the same catch block for exception handling:

} catch (Exception e) {
    e.printStackTrace();
    errors.add(ActionErrors.GLOBAL_ERROR,
               new ActionError("errors.general"));

    while (e != null) {
        errors.add(ActionErrors.GLOBAL_ERROR,
                   new ActionError("errors.detail", e.getMessage()));
        e = (Exception) e.getCause();
    }

    saveErrors(request, errors);

    return mapping.getInputForward();
}

After talking with Erik this morning, I decided to create an ActionExceptionHandler for java.lang.Exception. In my struts-config.xml, I added:

<exception type="java.lang.Exception" key="errors.general"
    handler="org.appfuse.webapp.action.ActionExceptionHandler"/>

I have "errors.general=The process did not complete. Details should follow." Here is the code for ActionExceptionHandler:

public final class ActionExceptionHandler extends ExceptionHandler {

    public ActionForward execute(Exception ex, ExceptionConfig ae,
                                 ActionMapping mapping,
                                 ActionForm formInstance,
                                 HttpServletRequest request,
                                 HttpServletResponse response)
      throws ServletException {
        ActionForward forward = null;
        ActionError error = null;
        ActionErrors errors = new ActionErrors();
        String property = null;

        // Build the forward from the exception mapping if it exists
        // or from the form input
        if (ae.getPath() != null) {
            forward = new ActionForward(ae.getPath());
        } else {
            forward = mapping.getInputForward();
        }

        ex.printStackTrace();
        errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(error.getKey()));

        while (ex != null) {
            errors.add(ActionErrors.GLOBAL_ERROR,
                       new ActionError("errors.detail", ex.getMessage()));
            ex = (Exception) ex.getCause();
        }

        // Store the errors and exception
        request.setAttribute(Globals.ERROR_KEY, errors);

        return forward;
    }
}

This allows me to remove my generic try/catches from my action classes - very slick IMO (or at least better than the code smell I had)! Of course, I still have some catch blocks that catch specific exceptions, but I can either (1) leave those intact, or (2) create another declared exception for that particular action/exception. I dig it and will be adding it (in short order) to AppFuse.

Update (June 23, 2003): Here's a more thoroughly tested code sample of this same class.

Posted in Java at Jun 19 2003, 05:55:20 PM MDT 3 Comments

The Matrix at Red Rocks

This looks pretty cool - they're showing "The Matrix" at at Red Rocks. Not the new one, the old one - which I've been longing to see again ever since I saw Reloaded. For those of you not familiar with Red Rocks, it's an awesome natural ampitheater - and it's only minutes from my house (15 minutes on a bike). I just might have to go - looks like fun.

Red Rocks

Posted in General at Jun 19 2003, 04:57:33 PM MDT Add a Comment

Sending POJOs to the UI instead of ActionForms

I'm starting to think that my Struts-based apps could be simplified if I didn't convert POJOs to Action Forms when retrieving them from the database. By this, I mean to say that I'd like to retrieve and display POJOs on the UI, and then capture their information (as Action Forms) when saving the form. The reason I want to do this is because of Hibernate's Lazy Loading feature and formatting Dates. Basically, Hibernate allows you to load children of an object lazily (i.e. resumes of a User), when the getResumes() method is called. I've created [a page|POJOsToForms] on my wiki to explain further and continue this discussion. Of course, you can always leave comments here if you'd rather - they cross-reference each other. The [RollingWiki|http://www.rollerweblogger.org/wiki/Wiki.jsp?page=RollerWikiPlugin] rocks!

Posted in Java at Jun 19 2003, 01:52:23 PM MDT 3 Comments

www.mail-archive.com

If you're doing development on an open source project, I recommend that you get your mailing list archived by mail-archive.com. It's pretty easy to setup and offers a nice google-like search interface. I recently added struts-apps, struts-menu-user and the display tag lists. I hope this makes it a lot easier for folks using these applications. I might even add Roller, but I figured Dave could handle that if he really wants it (it's already being done by gname anyway).

Either way, gname or mail-archive.com, if you're using a SourceForge mailing list, you'd better get a better archiving system b/c SourceForge's sucks! Why? No searching! What good is an archive without searching?!

Posted in Java at Jun 19 2003, 12:51:44 PM MDT 2 Comments

JSPWiki's RSS Feed

JSPWiki has a pretty slick RSS Feed. If you subscribe to it, it will show you the diffs for the pages that have changed since you last updated the feed. Now that is cool! All wiki's should have this feature IMO. If you're running JSPWiki, and you don't have an RSS feed, I think it's time to get one (hint, hint).

Posted in Java at Jun 18 2003, 05:25:57 PM MDT

The next Denver JUG meeting is going to be good

I'm really pumped to attend the next DJUG meeting on Wed., July 9th. There's going to be a celebration for being selected as a top 25 JUG, and Sue Spielman is going to be covering what's new in J2EE 1.4. It should be a good time for sure - who's up for beers afterwards?

Posted in Java at Jun 18 2003, 11:29:58 AM MDT 1 Comment

Pictures from White Ranch Yesterday

Nice Single Track

Jodie on the single track.

My Gary Fisher Sugar 3+

My Sugar Momma.

The Hill

Tony on "The Hill."

Posted in General at Jun 18 2003, 06:48:33 AM MDT 5 Comments

New Roller Feature: Comment Subscribers

I added a new feature to Roller last night. Now, if you have e-mailing of comments enabled, all the folks that have commented on a post will be cc'd when a new comment comes in. Here are the features/issues it currently has:

  • (Feature) Now a URL appears on the bottom of the e-mail with a link to comment on the post.
  • (Issue) Weblog owner is cc'd when they post a new comment. Since it's always "to" them, there's no need to cc them. I just noticed this after replying to another post - however, I only received one e-mail, so who knows.
  • (Issue) When a commentor does not specify an e-mail address, the from address is set to "[email protected]." I don't know if this is the best way, but it works for this initial cut.

You must specify an e-mail address to be cc'd on comments (of course). Feel free to give it a whirl.

Posted in Roller at Jun 18 2003, 06:26:08 AM MDT 4 Comments

[Display Tag] Now we're talking...

We're starting to get some real activity over on the display tag library project. I have to admit, I've done nothing - which is why it's even cooler that other folks are. Mathias joined the team and went on a rampage squashing bugs and formatting code. Then along came a guy named Fabrizio (no blog) who re-wrote the whole thing ~ demo. Even better - it's XHTML and CSS compliant.

There's even an editable table prototype being looked at. John York (no blog) has also done a lot in re-writing the library, and has his own version that I'm hoping to post soon. Nice work gents!

Posted in Java at Jun 17 2003, 03:16:20 PM MDT 11 Comments