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.

HowTo: Upgrade your app to JSP 2.0

I did some more playing with Tomcat 5.0.4 today - and converted appfuse to a JSP 2.0 application. After accomplishing this task, I created a "jsp-2" task that can (optionally) be run at build time, and whalla, you've got a Servlet 2.4/JSP 2.0 application. I learned a number of things in the process.

1. The expression language in JSP 2.0 replaces in JSTL is <c:out>, that's it. I was under the impression that I could use <c:if> or <c:forEach> tags without declaring the tag library URI, etc. I was wrong, if you want to use JSTL tags, you must import the declare the taglibs, just like you do now in Tomcat 4.x.

2. The EL is turned off by default if you have a 2.3 DTD for your web.xml. If you have a 2.4 XSD in web.xml, the EL is turned on by default. This means that you can write ${param.foo} and it will be analyzed when the EL is on (when off, it's not analyzed).

3. You can replace <html:rewrite page=""/> with <c:url value=""/> and get the same effect. The only difference is that html:rewrite is context and module-sensitive, whereas c:url is only context-sensitive.

4. I had to replace the URI's for JSTL core and fmt with their run-time URIs - http://java.sun.com/jstl/core_rt vs. http://java.sun.com/jstl/core. Otherwise, I would get something similar to the the following error.

According to TLD or attribute directive in tag file, 
  attribute test does not accept any expressions

I figure upgrading to JSTL 1.1 might solve this issue, but since it hasn't been released, why bother? So to convert appfuse to be a JSP 2.0 webapp, here's what my Ant task does:

  • Replaces URIs with their run-time equivalent.
  • Removes <c:out> tags, leaving the value of the "value" attribute intact.
  • Replaces 2.3 DTD in web.xml with 2.4 XSD.

I did some (rough) benchmarking of running my JSP tests, here are the results on a Pentium IV (2 GHz, 512 MB RAM).

start Tomcat, run tests, stop Tomcat:
 Tomcat 4.1.24: 1 minute, 17 seconds
 Tomcat 5.0.4: 1 minute, 7 seconds
 Tomcat 5.0.4/JSP 2.0: 1 minute, 3 seconds

run tests, Tomcat already started:
 Tomcat 4.1.24: 33 seconds
 Tomcat 5.0.4: 22 seconds
 Tomcat 5.0.4/JSP 2.0: 22 seconds

According to these numbers, Tomcat 5 is quite a bit faster than 4.1.x.

Posted in Java at Jul 17 2003, 01:27:01 PM MDT 5 Comments

Our new Internet Service from Comcast

Yesterday, Comcast showed up to install their cable internet service at our new house. Long story short: We bought a new house by DU, but haven't sold ours in Morrison yet. Hopefully it'll sell soon, or we'll be stuck paying two mortgages. I have to give a glowing review to Comcast and how everything was executed in setting up our service. One week ago, I signed up for (and scheduled) an appointment online to have Comcast High-Speed Internet installed. They called me to confirm my appointment two days before, and then gave me a 2 hour window that I had to be at the house. The guy showed up 5 minutes early, and was done 15 minute early. Sweet! We have nothing else in the new place (we haven't moved yet), but we have internet access - yeah baby, yeah.

I'm very impressed - it only took one week to get high-speed internet. Remember the days when it would takes months from the time you ordered DSL until it got installed? I'm pumped too because it's cable, which is the fastest IMO. I have friends in town with DSL and friends with cable; cable is much, much faster (~ 2MB down). You might think I'm biased because I currently work at Comcast. At Comcast, not for Comcast - I'm just a contractor, no benefits for me. The lucky bastards I work with get cable and high-speed internet for free - not to mention a TV in their office/cube (if they want).

Posted in General at Jul 17 2003, 06:17:55 AM MDT 6 Comments

A RaibleLand Holiday: My Birthday

I was born on this day 29 years ago, at 4:30 in the morning. I was born at the cabin, with only my dad (who is a Navy man, not a doctor) to assist. I came out with my umbilical cord wrapped around my neck and my whole head was blue. This had to be quite a surprise for my parents, doing the home birth and all. My dad, always good at thinking fast, grabbed his hunting knife from his belt and sliced that puppy off in a split second. And that's why I'm here today.

Ever since I worked at eDeploy.com, where they gave us our birthday's off, I've continued to take the day off. So today, there will be none of this blog checking, e-mail reading nonsense (save for an early morning peak) - but rather a whole bunch of goofing off, playing with my favorite ladies, and possibly some indulgence into a few of my favorite savory Colorado microbrews.

Posted in General at Jul 16 2003, 07:32:51 AM MDT 4 Comments

RE: Netscape is Dead

From Erik, via Doug.

AOL has cut or will cut the remaining team working on Mozilla in a mass firing and are dismantling what was left of Netscape (they've even pulled the logos off the buildings). [MozillaZine]

The good news is they've started the Mozilla Foundation:

The Mozilla Foundation is a new non-profit organization that will serve as the home for mozilla.org.  As before, mozilla.org will coordinate and encourage the development and testing of Mozilla code.  The Mozilla Foundation will also promote the distribution and adoption of our flagship applications based on that code. AOL, Sun Microsystems, Red Hat, and other companies will continue to support Mozilla through the Foundation.

What this means for the Mozilla browser and our other products and technologies: more innovation from the open source developers, and a greater focus on end users.

Read the press release and our newsgroup announcement.

I dig the new look for mozilla.org, nice work Ben!

Posted in The Web at Jul 15 2003, 07:33:50 PM MDT Add a Comment

Upgrading to latest WebTest and Cactus

I attempted (and succeeded) in upgrading to the latest and greatest releases of Canoo's WebTest and Jakarta's Cactus this afternoon. It wasn't too bad. Both have revised their taskdef's to read from a properties file, and Cactus has simplified the process to include cactus-related JARs/mappings in your webapps. Now you can "cactify" your war with a little Ant-lovin:

<cactifywar srcfile="${webapp.dist}/${webapp.war}"
    destfile="${webapp.dist}/${webapp.name}-cactus.war">
    <lib dir="${strutstestcase.dir}" includes="*.jar"/>
    <lib dir="${cactus.dir}">
        <include name="*.jar"/>
    </lib>
</cactifywar>

Pretty slick IMO. Now if I could only figure out how to do form-based authentication with Cactus (I couldn't find it in the docs).

The other issue I've been banging my head against the wall over is running canoo/httpunit tests with a compression filter enabled. Yep, the problems still exist, despite the fact that I patched httpunit. So I've come up with a new fix that satisfies me and eases the pain in my noggin'. In my compression filter, I simply disabled compression when it's an httpunit test:

String userAgent = req.getHeader("User-Agent");
if (!isGzipSupported(req) || userAgent.startsWith("httpunit")) {
    // Invoke resource normally.
    chain.doFilter(req, res);
} else { 
    // gzip it
}

Posted in Java at Jul 15 2003, 07:05:36 PM MDT 2 Comments

Fun with Tomcat 5.0.4

After reading Dave's post about Tomcat 5, I got interested and decided to try it out. For those that don't know, Tomcat 4.0.5 Alpha was released today. I figured out how to make AppFuse run through a series of steps. Basically, I had to put log4j.jar in $CATALINA_HOME/common/lib and appfuse.xml in $CATALINA_HOME/conf/Catalina/localhost. Details are on my wiki.

Posted in Java at Jul 15 2003, 04:14:15 PM MDT Add a Comment

Now sporting valid XHTML

Thanks to Will Gayther (no blog that I know of), this site now validates as XHTML 1.0 Transitional. You might recall that I had issues with the onload attribute of an iframe, but it was easily solved. Will suggested I put the onload into the <body> of my iframe's "src" document, but that seemed impossible, as the iframe doesn't have a source document - it's just submitted to. But he did turn me onto the solution. There is a function called when the form is submitted (onSubmitComments()), so I just called the function from there (instead of in the onload):

function onSubmitComments(aEntryId)
{
  gSubmittingComment = aEntryId;
  setTimeout("onCommentSubmitted()", 500); // wait 1/2 second
}

I don't expect you to care about any of this, just wanted to let you know I'm compliant again - or at least right now I am. Oh yeah, and I added this theme (sunsets) to Roller's CVS yesterday.

Posted in Roller at Jul 15 2003, 02:22:13 PM MDT Add a Comment

Struts: How to use Indexed Properties

James Turner has written a short-n-sweet article on using indexed properties with DynaForms. Of course, you could use any ol' ActionForm, but you get the idea. If you're struggling with indexed properties in Struts, or you're just curious to know what they are, read this article (estimated time 5-10 minutes, 6 printed pages - mostly code).

Now if we could only convince James to use XHTML (lower case HTML, close your tags, etc.) in his examples. wink A big pet-peeve of mine is uppercase HTML - XHTML is lowercase and HTML works just the same with lowercase tag names/attributes. Here's to future compatibility!

Posted in Java at Jul 14 2003, 11:07:10 AM MDT 2 Comments

Prevent Caching of JavaScript and CSS files

We've been having an issue at work for awhile now where our .css and .js files are cached by a proxy server. When we update the app, we get a few users (behind the proxy server) that get served up an old style/script file, and the app looks like it's broken. So I added a super-simple cache-killer to our .js and .css files today. In my taglibs.jsp (included in every JSP), I added:

<%-- Create a variable that is the current time (in milliseconds) to kill
     caching on the proxy server --%>
<jsp:useBean id="now" class="java.util.Date" />
<c:set var="cacheKiller">
    <fmt:formatDate value="${now}" pattern="yyyyMMdd"/>
</c:set>

My date pattern only goes to the day because we don't update the site more than once in the same day. This way, the users will still get the stylesheet/script caching benefit of the browser, but now we control when the file is reloaded, rather than the proxy server. To make sure these files are re-fetched every request, you could use pattern="yyyyMMddHHmmssS" to get all the way down to the millisecond. After adding this, I adjusted my baseLayout.jsp (Tiles template) to add my cacheKiller as a parameter to the src attributes of scripts and stylesheets.

<%-- Get Javascript List --%>
<tiles:useAttribute name="scripts" ignore="true"/>

<c:forEach var="js" items="${scripts}">
    <script type="text/javascript"
        src="<html-el:rewrite page="${js}"/>?<c:out
             value="${cacheKiller}"/>"></script>
</c:forEach>

Works like a charm!

Posted in Java at Jul 14 2003, 10:16:48 AM MDT 6 Comments

RE: The economics of writing a computer trade book

I found a good tidbit this morning (on the java-writers' mailing list) titled "The economics of writing a computer trade book." Good stuff to read if you're an author or wanting to be an author. Scott estimates the average payout for authors is $20/page for books and $50-$250/page for magazine articles.

Bottom line, write magazine articles if you're doing it for money. If you're doing it for fame, write a book. If you're writing a book, warn your family and friends that you'll be unavailable for the duration of your writing. Don't forget to mention you'll be stressed out, irritable and you'll bitch a lot that they're not paying you nearly enough for your efforts. Then plan a party when the book is released and give yourself (and your family) a pat on the back. I've been waiting to plan this party since March!

Posted in General at Jul 14 2003, 08:55:27 AM MDT Add a Comment