Matt RaibleMatt Raible is a Web Developer and Java Champion. 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.

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
Comments:

Hi Matt, If you know how to do BASIC authentication with Cactus then doing Form-based is easy. Try using http://jakarta.apache.org/cactus/writing/howto_security.html to get you started and post any question to the mailing list. I'm glad your upgrade went ok :-) Thanks -Vincent

Posted by Vincent Massol on July 15, 2003 at 11:09 PM MDT #

Awesome - that worked! And it was <em>very</em> simple to get working. Now the question is - can I put this in in a base class for all my Actions (extends CactusStrutsTestCase)? I'd love to have a setup where each Test class can call super.authenticate() and it authenticates using the following lines:

theRequest.setRedirectorName("ServletRedirectorSecure");
theRequest.setAuthentication(new FormAuthentication("tomcat", "tomcat"));

Posted by Matt Raible on July 18, 2003 at 08:23 AM MDT #

Post a Comment:
  • HTML Syntax: Allowed