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 "howto". 64 entries found.

You can also try this same search on Google.

Using the T68i as a GRPS Modem

I got inspired by Russ's post and decided to try once again to connect my PowerBook to the Internet using Bluetooth/GRPS. I found an OS X GRPS HowTo on AT&T's site, and whaddya know - I'm connected 10 minutes later. Very cool - 29.8 KB per second (according to http://bandwidthplace.com/speedtest). Hopefully, I'll never need to use this, but it's nifty to know it's there.

Posted in General at Aug 12 2003, 08:48:31 PM MDT 1 Comment

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

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

Search improvements and HowTo set your title

I did some re-factoring to the Google search box for this theme, and also figured out a slick trick to set your weblog's title to be == $lastPost.title. Basically, I refactored my _day template to add the search box when building the page, rather than after the fact.

You ask "why, I thought you loved the DOM?" I do, but it was giving me some strange behavior: in IE, a "entry" bar would show up in the middle of the last post (fixed by scrolling) and in Mozilla Firebird, I was getting a slight "shift-left 10px" behavior of the whole page. So I built it with Velocity, here's how. In my _day template, I changed this:

<div class="entry">
   #showDayPermalink( $day )
   #showEntryDate( $day )
</div>

To this:


<div class="entry">
#if ($velocityCount == 1) 
  <div id="search" style="float: right; margin-top: -2px">
    <form id="searchForm" method="get" onsubmit="return search()"
        action="http://www.google.com/search"
        style="margin: 0; padding: 0">  
        <input type="text" id="q" name="q" size="20" 
            maxlength="255" value="search this site" 
            style="font-size: 11px; border: 1px inset silver; 
                   font-weight: normal; padding-left: 2px"
            onclick="this.value=''" /> 
    </form>
  <script type="text/javascript">
    function search() {
        form = document.getElementById("searchForm");
        if (form.q.value == "search this site" || form.q.value == "") {
            alert("Please enter a search term to continue.");
            form.q.focus();
            return false;
        } else {
            form.q.value = form.q.value + " site:www.raibledesigns.com";
            form.submit();
        }
    }
    document.title="Raible Designs ~ $entries.get(0).title";
  </script>
  </div>
#end
   #showDayPermalink( $day )
   #showEntryDate( $day )
</div>

There's also a hint in there to set your weblog's title to match the title of your last post. Enjoy!

Posted in Roller at Jul 01 2003, 02:46:22 PM MDT Add a Comment

HowTo: JSP Progress Bars

As web interfaces become ubiquitous, more and more complex back-end processing is necessary. Of course, stateless HTTP leaves few ways to tell users what's going on. Andrei Cioroianu presents a JSP technique to display application "progress bars." [ONJava.com]

It's too bad there's so much scriplet action in this example, but the lesson is good. It'd be even nicer to see a JSTL port of this howto, or an alternate view approach (i.e. using Velocity or XML/XSL).

Posted in Java at Jun 30 2003, 06:32:03 AM MDT 4 Comments

Tomcat's Ant Tasks - why they don't work for me

I've written up a howto for implementing [Tomcat's Ant Tasks|TomcatAntTasks] and why they don't work for me. I've been requested by a few users to use them vs. my current <copy> method, but I don't see why I should. Please read the wiki page and help me out if you can.

Posted in Java at Jun 24 2003, 04:12:32 PM MDT Add a Comment

Wiki Improvements

I made a few wiki improvements today. Most notably was upgrading to the latest and greatest cvs snapshot (2.1.38-cvs). Yeah, that's right, I like to run all the beta or in-cvs software =80). Call me silly, but I'm doing it because I want the latest features (i.e. XHTML syntax and an RSS Feed) and I want to keep up-to-date as possible. It actually works quite well, and I'm in the midst of making my Redman theme into a contribution for JSPWiki. I still have lots of improvements to make, but it is currently in it's own templates directory.

New today - a short howto for configuring Tiles' definitions to include certain .css and .js files on a page-by-page basis. Also, thanks to Dave for the press!

Posted in General at Jun 14 2003, 07:24:19 PM MDT

JavaScript: removeChild HOWTO

I experienced a small issue this morning when trying to remove all the children from a <td> using the following:

// cells[i] is a td in a table
var kids = cells[i].childNodes;
for (j=0; j < kids.length; j++) {
    cells[j].removeChild(kids[j]);
}

This (for some reason) doesn't work. So, in the interest of helping others and getting picked up by Google, here's the solution (actually found via Google).

while (cells[i].childNodes[0]) {
    cells[i].removeChild(cells[i].childNodes[0]);
}

HTH!

Posted in The Web at Jun 10 2003, 10:38:38 AM MDT 8 Comments

DHCP and Dynamic DNS on Red Hat

I found a great howto today for setting up DHCP and Dynamic DNS server on Red Hat 8.0. It literally took me about 5 minutes to get it installed and running. 5 minutes later, I had all my machines (WinXP, Win2K, OS X, Linksys Print Server) connected and working. Very slick!

Even better is I did it with Red Hat 9, which I downloaded last weekend and installed lazily over a few days. The upgrade from 8.0 was like butter. I like Void Main's Red Hat Tips so much, I'm tempted to mirror them in hopes this URL won't go away. But for now, I'll have faith and hope it's a true permalink. Hope you don't mind that I've stuffed this under my Java category - just doesn't seem fit for General.

Posted in Java at May 04 2003, 02:54:47 PM MDT Add a Comment

Is it possible to lock files with CVS?

I don't think this is possible, but since a co-worker asked - I'm relaying the question to you, the experts. Using CVS, it is possible to "checkout" a file for editing, and to lock it on the CVS server, so no one else can check it in. If this feature exists, I'd love to use it. Also, if anyone knows how to hookup sending e-mails for commits on a barebones CVS install, enlighten me. SourceForge makes it easy using synchmail, but Google doesn't even know about this tool - must be a SF script.

Update: Anthony has given me some good tips in the comments of this post. I've had some success in getting e-mail notification setup, but I'm still having some issues. To configure it, I checked out CVSROOT, and edited the loginfo file, adding the following line:

^project /usr/bin/mailx -c $USER -s "[cvs-commit] %{sVv}" [email protected]

When I get in a file, I get:

Checking in build.properties;
/export/home/cvsr/project/build.properties,v  <--  build.properties
new revision: 1.7; previous revision: 1.6
done
1.6... User unknown
1.7... User unknown
build.properties... User unknown
/export/home/mattra/dead.letter... Saved message in /export/home/mattra/dead.letter

I do receive the e-mail, but it's addressed to 1.6@cvsserver, 1.7@cvsserver, build.properties@cvsserver and [email protected]. I'm sure it's an easy fix, comments are appreciated.

Update 2: Our SysAdmin solved the e-mail issue with the following lines in loginfo:

^project /usr/bin/mailx -s '[cvs-commit] %{sVv}' [email protected]
^server_config /usr/bin/mailx -r [email protected] -s '[cvs-commit] %{sVv}' [email protected]

I'm no UNIX expert, so that's why I'm posting this here - that way I can use it the next time I need to set this up. Alternative approaches are welcome and encouraged!

Posted in Java at Feb 07 2003, 07:23:56 AM MST 6 Comments