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.

Private Weblogs in Roller

I've used a "quick and dirty" technique for making a private roller weblog for family members only. Maybe Lance can use this to create a private weblog for his mom ;-)

  1. Create a new roller user: i.e. "mom"
  2. Create a user for user's to login with (I just created another roller user): i.e. "kids"
  3. Add a new role (i.e. "family") to the "role" table in your database
  4. Add two new records to the role table so the "mom" and "kids" roles have the "family" role
  5. Add the following to web.xml:

    <security-constraint> 
        <web-resource-collection>
            <web-resource-name>My Family</web-resource-name>
            <description>Restricted to Family Members Only</description>
            <url-pattern>/page/mom/*</url-pattern>
            <url-pattern>/rss/mom</url-pattern>
            <http-method>POST</http-method>
            <http-method>GET</http-method>
        </web-resource-collection>
    
        <auth-constraint>
            <role-name>editor</role-name>
            <role-name>family</role-name>
        </auth-constraint>
    </security-constraint>
    
  6. Distribute the "kids" username/password to the appropriate parties.

Hope this helps!

Posted in Roller at Aug 25 2002, 03:19:54 PM MDT 2 Comments

Upgrading from Tyrex 0.9.7 to Commons DBCP.

I'm trying to upgrade from Tyrex 0.9.7 (ships with Tomcat 4.0.4 for connection pooling) to the Commons DBCP (ships with Tomcat 4.1.x for connection pooling). I've set it up according to these instructions. However, my connections don't seem to be getting closed, or it's closing the connection pool and I get a "connection is closed" error.

If I use this method to close connections, I get "connection is closed:"

    /** Closes a connection from the connection pool */
    public void closeConnection(Connection con) throws ServiceLocatorException
    {
        try {
            con.close();
        } catch (SQLException sqle) {
            logger.error("SQLException: " + sqle.getMessage());
            throw new ServiceLocatorException(sqle);
        } finally {
            if (con != null) {
                // try again
                try {
                    con.close();
                } catch (SQLException csqle) {
                    // ignore
                }
            }
        }
    }

I changed my closeConnection method (see below). It seems to work better (no closed connection error), but I am wondering about the open connections to mysql. When I monitor them (show status; watch Threads_connected), there are 3 at first (I'm guessing from my monitor connection, JDBCRealm and Connection pool). It gets up to 5, any tips on how I can tell if connection pooling is working?

    /** Closes a connection from the connection pool */
    public void closeConnection(Connection con) throws ServiceLocatorException
    {
        try {
            con.close();
        } catch (SQLException sqle) {
            logger.error("SQLException: " + sqle.getMessage());
            throw new ServiceLocatorException(sqle);
        } finally {
            // try again
            try {
                if (!con.isClosed()) {
                	con.close();
                }
            } catch (SQLException csqle) {
                // ignore
            }
        }
    }

I think the problem is that it's not creating a "pooled" connection. When you are using a connection pool, con.close() should just return it, not actually close it - right?

In my getPooledConnection method, I'm getting "Non-Pooled Connection" each time.

    /** 
     * Retrieves a connection from the connection pool
     */
    public Connection getPooledConnection() throws ServiceLocatorException
    {
        try {
            ds = (DataSource) getEnvContext().lookup(Constants.JNDI_DB);
        } catch (NamingException ex) {
            logger.error("NamingException: " + ex.getMessage());
            throw new ServiceLocatorException(ex);
        }
        
        try {
            if (ds instanceof ConnectionPoolDataSource) {
                ConnectionPoolDataSource poolDataSrc = (ConnectionPoolDataSource) ds;
                PooledConnection pc = poolDataSrc.getPooledConnection();
                con = pc.getConnection();
                if (logger.isDebugEnabled()) {
                    logger.debug("Pooled Connection");
                }
            } else {
                if (logger.isDebugEnabled()) {
                    logger.debug("Non-Pooled Connection");
                }
                con = ds.getConnection();
            }
        } catch (SQLException ex) {
            logger.error("SQLException: " + ex.getMessage());
            throw new ServiceLocatorException(ex);
        }
        return con;
    }

If you have a WAG/suggestion, please enlighten me!

Posted in Java at Aug 24 2002, 04:12:15 AM MDT Add a Comment

Problems with UserTransaction/Tomcat on OS X

I'm having some problems getting a "UserTransaction" to work in a Struts Action on Tomcat 4.0.4 in OS X with JDK 1.3. The same code works fine on Windows XP/Red Hat Linux 7.2-.3 with JDK 1.4. Maybe it's a JDK 1.3 issue? Any suggestions/tips are appreciated.

Posted in Mac OS X at Aug 24 2002, 04:01:36 AM MDT Add a Comment

Cool Trick on OS X.

I found this by way of Ben Hammersley's post. You can adjust the transparency of your terminal window - VERY cool in my book.

Open a terminal window and write this:

defaults write com.apple.terminal TerminalOpaqueness .4

Hit return, and then close and reopen the terminal window. Adjust the number to taste. Mmmmm

Posted in Mac OS X at Aug 23 2002, 03:47:42 AM MDT Add a Comment

Jaguar - can you wait?

I ordered my copy on Wednesday evening from Mac Warehouse. I saved $30, but I'll have to wait until next week sometime to get it. Russell Beattie showed me how Ben reacted to his new addition.

Ben Hammersley just got OSX 10.2 Jaguar in this morning, he's very excited about it.

I'm excited to get it b/c I think it's a cool new OS, and I've always been upgrade happy. My biggest reason is probably b/c I'm hoping for some more speed. I bought a Powerbook G4 last Christmas with 766 Mhz and 1 Ghz of RAM, and it's a lot slower than I expected.

I can wait b/c I only use my Mac for about 8 minutes each day. I've tried to move from Windows XP to OS X and Red Hat 7.3, but I just can't seem to do it. The reason? I like the speed and the applications for XP. And my XP box has 1/2 the RAM as my OS X laptop. Also, since I've been a Windows user my whole life, the whole 1-button mouse is annoying (and it still annoys me, especially when you can plugin an external mouse and get 2-button functionality). I know about the Ctrl-click thing, but I've always been about speed and efficiency...

Posted in Mac OS X at Aug 23 2002, 01:40:35 AM MDT Add a Comment

Am I color blind?

As I sit here pounding the keyboard on a late night, get-it-done-before-the-deadline (that's tomorrow), I stumbled upon's Eric Costello's standards compliant Blogger template with DOM-based font customization features and silly randomly morphing color scheme. See it here - you might think you need your eyes checked too! (Tip: I had to refresh in some browsers to get it to work.)

Posted in General at Aug 22 2002, 06:15:32 PM MDT Add a Comment

How do you sell Web Standards?

Don't sell. Show.

Posted in The Web at Aug 22 2002, 07:04:22 AM MDT Add a Comment

Reason to QA your site.

This guy seems to work for Microsoft, and you can tell, have you looked at his blog in Mozilla? It gets a little ugly, not unreadable, but enough to make you wonder.

My opinion on browsers is: IE rocks on both OS X and Windows XP for one reason, and one reason only - it opens faster. That's it, the only reason I have. I really like Chimera (for OS X) and Mozilla, but they just take too long to open. I'm impatient. Even on Linux, Konquerer tends to open faster, so I use it more than Mozilla.

Posted in General at Aug 22 2002, 06:23:37 AM MDT Add a Comment

CSS and IE 6.

Did you know that IE6/Win does not know the difference b/w dotted and dashed - view this post in Mozilla to see how it's really supposed to look. Maybe their next release will be more standards-compliant. This happens even with standards-compliant mode turned on.

Posted in The Web at Aug 22 2002, 02:51:49 AM MDT Add a Comment

Struts Code Generator for Eclipse.

Easy Struts 0.5.0 just released. This is a code generator that seems like a nice product - I've installed it, but never used. I think these types of tools are great for developers that love to use an IDE. If you're like me and you prefer a good ol' text editor - this tool won't help you.

Posted in Java at Aug 22 2002, 02:44:13 AM MDT Add a Comment