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.

AjaxAnywhere

From Ajaxian.com:

AjaxAnywhere is designed to turn any set of existing JSP components into AJAX-aware components without complex JavaScript coding. In contrast to other solutions, AjaxAnywhere is not component-oriented. You will not find here yet another AutoComplete component. Simply separate your web page into multiple zones, and use AjaxAnywhere to refresh only those zones that needs to be updated.

This is one of the few Ajax projects I've seen that looks to provide a lot of value w/o a whole lot of work. Notice how much it enhances JSF with this cool demo.

Posted in Java at Sep 16 2005, 08:52:29 AM MDT 4 Comments

Jetty vs. Tomcat vs. Resin: A Performance Comparison

This morning, I did some comparisons between Jetty 5.1.5rc1, Tomcat 5.5.9 and Resin 3.0.14 (OS version). I ran AppFuse's "test-canoo" target, which tests all the JSPs using Canoo WebTest. I did this as a Servlet 2.4 application, and had to tweak some stuff in my web.xml to make it work on Jetty and Resin. Nothing big, just stuff that Tomcat let pass through and these servers didn't. One interesting thing to note that Resin requires you to use "http://java.sun.com/jstl/fmt" for JSTL's "fmt" tag URI, while Jetty and Tomcat require "http://java.sun.com/jstl/fmt_rt". This is with Resin's "fast-jstl" turned off - b/c everything blows up if it's turned on (I don't feel like coding my JSTL to Resin's standards, that's why I turn it off).

Below is a list of the average time it took to run "test-canoo" after I ran it once to compile all the JSPs.

  • Jetty: 19 seconds
  • Tomcat: 19 seconds
  • Resin: 29 seconds

In addition, I tested how long it took for each server to startup - including the initialization of AppFuse.

  • Jetty: 7 seconds
  • Tomcat: 8 seconds
  • Resin: 13 seconds

So what does all this mean? A number of things:

  • I need to clean up AppFuse's web.xml a bit for 2.4 applications.
  • Putting the database connection pool configuration in a Spring context file (vs. JNDI) makes AppFuse much more portable.
  • Jetty isn't as fast as Jetty-lovers say it is (or maybe Tomcat just caught up).
  • The open source version of Resin is much slower than the other open source servlet containers.
  • I should restructure the build.xml to pull out Tomcat stuff and allow users to specify server deployment settings (i.e. in a ${servername}.xml file).
  • Orion still doesn't support the Servlet 2.4 or JSP 2.0 specifications.

Posted in Java at Sep 15 2005, 10:52:50 AM MDT 12 Comments

Should I change AppFuse's default web framework?

Currently, the default web framework in AppFuse is Struts. It's nothing fancy like Shale or Struts Ti, but rather Struts Classic. Even though Struts is not dead it's a pain in the ass to work with compared to other MVC frameworks like Spring MVC and WebWork. Yesterday, on the AppFuse Mailing List, I kicked off an informal poll about switching to a different default web framework. I think most of the people that choose Struts w/ AppFuse are choosing it b/c it's the default. Making another framework the default would likely same quite a few users a lot of headaches.

So which one should I make the default? Here's my thoughts from the mailing list thread:

I like Spring MVC and WebWork better than Struts, but I believe that WebWork is much easier to understand and develop with. Unfortunately, it's not well documented or marketed, so it's a bit difficult when you run into snags. Of course, if you contact the user community via forums or e-mail, answers flow quickly.
...
I'd like to use the framework that's simplest to understand. Right now, in my eyes, that's WebWork. I think JSF and Tapestry are excellent too (as component-based frameworks), but Tapestry's learning curve is difficult and JSF has a lot of issues (like everything is a post). Hopefully things will get better with JSF 1.2, but it's probably another 6 months before MyFaces supports 1.2 - let alone the app servers.
...
Maybe we should just drop Struts altogether - or replace it with Struts Ti? Unfortunately, it'll probably be a while before it's ready for production (I doubt it's that useable now).

Of course, if a WebWork Book was out - this move would be a lot easier. I did talk to Patrick Lightbody on IM yesterday and he said "it's done" and supposedly he has copies, but I haven't seen anything on the WebWork Blog to prove this.

A related question: how much would it hurt AppFuse if I dropped Struts altogether and went with something like Wicket instead? I'd like to keep that cap at 5 web frameworks. If I dropped Struts and added Wicket, I might lose potential users, which might not be a bad thing. ;-)

Posted in Java at Sep 15 2005, 07:32:51 AM MDT 32 Comments

Biled Again, this time because my design sucks

Looks like I've been biled again. Unlike the last time, this time Hani doesn't offer any specifics, he merely says that my OSS efforts don't do anything other than the "very very basics".

Java, specifically, goes a long way towards ramming down a set of design principles. Said principles are followed fairly blindly by most practitioners. The OSS world is awash with examples of people who have read the right books, but have absolutely no skill or talent at conceptualising or grokking the underlying principles behind the books. To them, the design pattern is an end goal, not a tool. To pick one example (out of thousands), look at Matt Raible's OSS efforts. It has inheritance! It uses PATTERNS! It is LIGHTWEIGHT! Yet, I'd argue that it's very badly designed (if you don't believe me, just try getting it to do anything other than the very very basics.)

I'm assuming that Hani is speaking about AppFuse and Equinox, because my other efforts in OSS are minimal (Roller, Display Tag, XDoclet and Struts Menu). The reason I'm writing this post is because I'm curious to know what Hani tried to do that didn't work? Was it AppFuse/Equinox that failed? Or was it the underlying framework? Did he try to do indexed properties with WebWork or modify build.xml to deploy to Orion? Is the feature he's looking for something we can fix?

As a defense of my use of patterns, lightweight containers, etc. - it's not so much my doing that these happen to exist - they're more of a reflection on what user's want. It's a problem with Java developers in general - if you're not using patterns - users want to know why. Furthermore, most of the J2EE patterns in AppFuse are from the underlying frameworks, not from anything that I did.

As far as the design of AppFuse, I agree it could use some work. There's a lot of stuff in AppFuse that I don't use - so when I start a project with it - I usually rip out about 20-30% percent of it's features b/c I won't use them. Unfortunately, it's not that easy for others to do this b/c they don't know what they'll break if they remove a bunch of stuff. I'd like to move to a more modular, plug-in type architecture - but I have a feeling that that's the path to over-engineering. Even so, it would be pretty cool if it was possible to turn on/off features (even the use of a particular web framework) by changing a properties file.

Posted in Java at Sep 14 2005, 08:58:58 PM MDT 8 Comments

WebWork Books

What is it about WebWork that makes it so hard to write books about? I remember talking to Kris Thompson (a.k.a. the guy that quit blogging) last summer about WebWork in Action. At that time, it was "almost done". Over a year later and it's still "due out next month" (or is it done?). Almost as bad is Matthew Porter's WebWork Live, which was started late last year. I remember Matthew saying he expected to finish the initial version in March - and there's still not an ERP almost 10 months later.

Here's my guess: the Manning book has been done for months, but the publishing process takes months. As for Porter, my guess is he's too busy providing outstanding support at Contegix to work on the book. Any good conspiracy theories out there? Maybe WebWork has too many patterns that need to be documented? ;-)

Posted in Java at Sep 14 2005, 05:23:04 PM MDT 3 Comments

Stripes

Greg Hinkle writes about a new JDK 5-only Java web framework called Stripes.

Stripes is a presentation framework for building web applications using the latest Java technologies. The main driver behind Stripes is that web application development in Java is just too much work! It seems like every existing framework requires gobs of configuration. Struts is pretty feature-light and has some serious architectural issues. Others, like WebWork 2 and Spring-MVC are much better, but still require a lot of configuration, and seem to require you to learn a whole new language just to get started.

I dig the fact that someone is trying to create a web framework that requires less configuration. It's also very cool that they've released it as 1.0 (rather than 0.1 as many OS projects do) and it also seems to be well documented. Unfortunately, it doesn't look like there's any support for Spring or dependency injection.

Personally, I don't mind the configuration required by WebWork or Spring MVC - but then again, I use AppFuse and tend to generate most of the configuration code using AppGen. Even so, it would be nice to get away from the configuration requirement. Hopefully more framework authors will find ways to reduce or even eliminate the XML hell we have in Java web frameworks. Kudos to the Tapestry developers for doing this in their 4.0 release.

I like the convention over configuration that Rails uses. It's this same mantra that I've been trying to develop AppFuse with for the past few years. The problem with Java web frameworks is developers want configuration choices - even if they never bother to use them.

Posted in Java at Sep 06 2005, 09:56:41 PM MDT 6 Comments

Using Acegi Security for Remember Me and SSL Switching

I spent some time yesterday converting AppFuse's homegrown Remember Me and SSL Switching system to using Acegi Security. Thanks to Justin Spears, who provided the original motivation. It was much easier than I thought it would be, and resulted in the deleting of 7 classes in AppFuse. Not only that, but only one of them had a test for it, so the test coverage has naturally gone up as well. I'll trade 40 lines of XML for 1214 lines of Java any day - especially when I can get the support of an open-source framework. ;-)

If you're interested in using this code over 1.8.2, you can checkout the latest code from CVS (or download it from http://appfuse.org/nightly). The only other change currently in CVS is changing from "tomcat" to "user" as the default User role. Below is a list of classes that were removed as part of this move to Acegi:

  • src/dao/org/appfuse/model/UserCookie.java
  • src/service/org/appfuse/util/RandomGUID.java
  • src/web/org/appfuse/webapp/action/LoginServlet.java
  • src/web/org/appfuse/webapp/filter/LoginFilter.java
  • src/web/org/appfuse/webapp/taglib/SecureTag.java
  • src/web/org/appfuse/webapp/util/SslUtil.java
  • test/web/org/appfuse/webapp/action/LoginServletTest.java

I should also mention that I owe a big thanks to Virtuas - who pays me to work on AppFuse these days. :-D

Posted in Java at Aug 29 2005, 09:25:37 AM MDT 11 Comments

[ANN] AppFuse 1.8.2 Released

This release is mostly a bug fix release with no new features. It also includes upgrades to Acegi Security and the Spring Framework. Thanks to all the sponsors who have contributed products and free hosting to the AppFuse project.

To see how AppFuse works, please see the following demos:

Comments and issues can be sent to the mailing list or posted to the AppFuse Issue Tracker.

P.S. I have the Acegi integration done for Remember Me and SSL Switching in another project, so that support should be in CVS sometime next week. Thanks to Justin Spears for his help on this issue.

Posted in Java at Aug 27 2005, 06:42:06 PM MDT 12 Comments

Using CruiseControl with Subversion

This morning, I had the pleasure of setting up an AppFuse-based project to run under CruiseControl. Normally, this is very easy to do because I have the CruiseControl setup files and instructions. However, this project uses Subversion instead of CVS. Luckily, Subversion is easy to use and I was able to modify things to work quite easily. Below are the steps you can take to modify your AppFuse project to run under CruiseControl and Subversion.

  • Download svant and extract it to your work directory.
  • In build.xml, change your "cvs" target to "svn" and change the tasks appropriately.

        <path id="svn.classpath">
            <fileset dir="svnant-1.0.0-rc1/lib" includes="*.jar"/>
        </path>
            
        <taskdef resource="svntask.properties" classpathref="svn.classpath"/>
        
        <target name="svn">
            <delete dir="checkout/appfuse"/>
            <svn>
                <checkout url="https://svn.java.net/svn/appfuse/trunk" 
                    revision="HEAD" destPath="checkout/appfuse" />
            </svn>
        </target>
    
  • Modify the "test" target in build.xml to depend on "svn".
  • In config.xml, change the <modificationset> to be <svn LocalWorkingCopy="/home/cc/work/checkout/appfuse"/> instead of the <cvs> equivalent.

The instructions have been documented on the wiki and checked into AppFuse's CVS.

Posted in Java at Aug 24 2005, 10:24:26 AM MDT 4 Comments

What do you want to see at Java in Action?

I'm presenting two sessions at Java in Action in October. The first one is a 3-hour tutorial on Comparing Java Web Frameworks, while the second is about Developing Next Generation Web Applications with Ajax in Spring. I'm in the process of writing both of these, and I'm interested to see what Java developers would like to see in these talks.

The tutorial is probably the toughest one because my normal presentation usually only takes about an hour to deliver. For a similar presentation, see Craig McClanahan's The Evolution of Web Application Architectures. I could talk about the history like Craig does, or I could talk about the different frameworks and their features like I usually do. However, I want something more interactive and fun for attendees. I was thinking of live-coding for 20 minutes with each framework, and showing the differences, but that's not a whole lot of fun either. Maybe I could divide the class into 5 groups, educate each of them on features of the framework, and then we could have some sort of debate? Showing code is always something that developers are interested in, so I'll have to figure out how to work that in as well. If you're planning on attending this tutorial - I'd love to hear suggestions.

I'm also curious on what you'd like to see in the 2nd presentation? I was planning on using Equinox (or possibly AppFuse), to show how to use DWR, Prototype and script.aculo.us. A couple of examples I'm thinking of showing are in-page updates and sortable/pageable tables. Any other cool effects or tricks you'd like to see?

Sorry for the cross-post from JRoller, but I wanted to reach the largest possible audience. Please leave comments on the JRoller entry.

Posted in Java at Aug 22 2005, 10:23:34 PM MDT