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 "java web frameworks comparison". 2,229 entries found.

You can also try this same search on Google.

AppFuse Startup Video?

Dion wants to see an AppFuse Startup Video like Mike Clark's CruiseControl Action Movie. While this sounds like a good idea, I think I'd be shooting myself in the foot if I created it. Why? Because then more folks would start to use AppFuse, and hence, I'd have to answer a lot more e-mails on the mailing list. Being a top-ranked project on java.net doesn't help. You might think that there's a lot of issues with AppFuse, and that's why the mail traffic is so high, but that doesn't seem to be the case. Most questions seem to be along the lines of "Why did you do this?", "What do you think about adding X technology?" or "My Hibernate relationships don't work."

Few of the issues relate to AppFuse directly (i.e. build file and directory structure), but many of them relate to the technologies it depends on. Good HowTos should lead to a lot less Hibernate questions, and I hope to work on that before the next release. As far as the other questions, I need to add some links from the FAQ to the mail archives so I can quite repeating myself. I think a lot of the mail traffic is just an indication of a successful open-source project. In other words, when you get popular - you have little time to develop anymore. I probably spend 1-2 hours per day just answering AppFuse e-mails.

Another unfortunate side-effect of this is that there seems to be a lot of newbies. When AppFuse was first released in April 2003, it seemed that only experienced, smart developers used it. Maybe this was because there wasn't any documentation (besides Pro JSP and Java Development with Ant, which explains the entire build.xml file), so folks had to really understand the dependent technologies to use AppFuse. Now there's questions about the basics of different frameworks. In most cases, I'd like to respond to a link to the framework's documentation - but sometimes the documentation just isn't there. I guess that's why frameworks like Ruby on Rails succeed - all the dependencies are part of the framework. If I tried to do that in the Java Community, it'd be project suicide. I'd spend all day answering questions like, "Why aren't you using Hibernate?", "Why Not Spring/JSF/Struts, etc." Furthermore, I'm not as smart as the framework developers, so it'd simply never happen.

But I digress. What's in it for me if I create an AppFuse Startup Video? I can see what's in it for Mike - his video is about a project he doesn't support (AFAIK) and the video should lead to more book sales. I suppose I could try and hook users that AppFuse is explained in Spring Live, but that's not really the case. Maybe I should just do an Equinox Startup Video. ;-)

Posted in Java at Jan 24 2005, 10:29:12 AM MST 15 Comments

Comments are flakey?

I've gotten several e-mails from readers that they haven't been able to leave comments on this blog. I suspect it has something to do with twisty comments, but I just tried them in Firefox 1.0 on Windows XP and they seem to be working fine. In order to help me track down this problem, try posting a comment to this entry and see if it works. Make sure and copy it before you post it, just in case it doesn't work. Clicking on the "Permalink" or title for this post will take you to a backup comment form that seems to work regardless. Thanks for the help!

Update: From the various comments, there doesn't seem to be a common thread. It seems that half the folks that used Firefox + XP it worked for and the other half it didn't. I doubt it's a caching issue, but I have been seeing a lot of the following in my logs:

ERROR 2005-01-22 19:51:01,944 | RequestProcessor:processMapping | Invalid path /comment was requested

Roller recently changed from using /comment to /comments - so I don't know if it's spammers hitting the old URL or what. My guess is yes since it seems to happening in blocks. I'll try to add a preview button tonight so users will get taken to the permalink form for previewing. Either that or I could just change to always using the permalink form. It's up to you guys - let me know what you prefer.

Posted in General at Jan 21 2005, 10:31:52 PM MST 30 Comments

RE: Hype: Ruby on Rails

Patrick thinks that Ruby on Rails is all hype.

Now maybe I'm just a bit biased since my framework isn't getting all the slashdotters oohing and awwing over it, but I think Ruby on Rails is way over hyped. The tutorial here is great and gave me a very good overview of what it does. At the end of the day, RoR is simply a RESTful CRUD framework.

I'd like to agree with Patrick, because that is my natural tendency when I see a project that everyone praises. But I know better. I think it's better not to speculate on the productivity or usefulness of a framework until you've used it to develop an app.

That's what I did with Spring, WebWork, Tapestry and JSF last year. Now I feel like I know "the truth" and whether one framework is better than the other. The truth is they all have strengths and they all have weaknesses. While one might work well for one project, it might not for the next. I think the best thing is that you don't setup yourself for framework lock-in. If you only know one web framework for Java, you should probably pick up a book and develop an app with another framework - just to see how things are done differently. Now that I've used all of the Big 5 in Java, I don't think it would be that hard to migrate an app from one framework to next.

So what am I trying to say? Don't bash on a framework until you've tried it. And I don't mean toying around with it on a Tuesday night, I mean using it for a real-world project. I'll probably diving in and doing a little Rails development later this year. Why? So I can see if all the hype is accurate. ;-)

Posted in Java at Jan 21 2005, 01:40:37 PM MST 8 Comments

Maven Console and setting properties

I've been using Maven at my new gig and the Maven Console in order to avoid its painfully slow startup times. Using a slow-ass PowerBook in conjunction with Maven makes my face turn read and my ears smoke sometimes, but I'm getting used to it, much to my dismay. While the console has made things tolerable, Maven itself keeps getting in the way. I hate how it *requires* me to run my tests everytime I build or deploy. So I've turned that off by creating a build.properties file with "maven.test.skip=true". The problem with the Maven Console is it doesn't let me turn tests back on, so I'm stuck with running "maven test -Dmaven.test.skip=false" when I want to run my tests.

There's two ways I can think of to solve this problem:

  • If "maven idea:multiproject" allows me to setup my project so that Tomcat/Resin/whatever can point to my source directory and I don't have to deploy. I'm a web developer, and I typically have to run "maven deploy" to test simple UI changes. That's why I turn the tests off - because I want a 1-2 second turnaround to see my changes. BTW, it's too bad there's no "eclipse:multiproject" goal.
  • Enhance the console so it's possible to set properties. For example, typing "-Dmaven.test.skip=false" would set the property so the next time I run "maven war", my tests would be run. That, or allow me to run "maven war -Dmaven.test.skip=false". Allowing this would also make it possible to run a single test from the command line, instead of all (the only current option).

Posted in Java at Jan 20 2005, 09:43:30 AM MST 11 Comments

JCIFS and jWebUnit

On my current project, we're using JCIFS to integrate our application authentication process with NT Domain logins. While I found it quite easy to integrate, the one issue I found is I couldn't replicate the login process in a jWebUnit test. I tried setting the WWW-Authentication header to NTLM, but couldn't get it to work. The solution I ended up using is to subclass the NtlmHttpFilter and disable authentication when the User-Agent is "httpunit".

public class LoginFilter extends NtlmHttpFilter {

  public void doFilter(ServletRequest req, ServletResponse res,
                         FilterChain chain)
    throws IOException, ServletException {
        HttpServletRequest request = (HttpServletRequestreq;
        String userAgent = request.getHeader("user-agent");

        // prompt for login, except when jWebUnit is used
        if (userAgent == null || !userAgent.startsWith("httpunit")) {
            super.doFilter(req, res, chain);
            return;
        }

        chain.doFilter(req, res);
    }
}

Hopefully this is useful for others. If you've managed to get regular jWebUnit authentication working with NTLM, I'm all ears.

Posted in Java at Jan 20 2005, 09:34:41 AM MST 16 Comments

Using JasperReports with AppFuse and Spring

In Spring 1.1.3, support was added for using JasperReports with Spring MVC. Today, Gregory Beumer posted a nice overview of JasperReports. This inspired me to dig up Gilberto's post on How to integrate JasperReports with AppFuse. If you're looking for a reporting solution in your AppFuse-based application, and you're using Spring MVC ... enjoy! I plan on adding this to the wiki in the future, along with howtos for integrating JasperReports with Struts, WebWork, JSF and Tapestry. If you happen to know of tutorials for integrating JasperReports with these other frameworks, please let me know.

Posted in Java at Jan 20 2005, 08:12:04 AM MST 17 Comments

AppFuse distributed with Gentoo Linux?

According to the Gentoo Java Roadmap, AppFuse is on the list of apps to integrate. Nice! I'm going to rebuild my Windows 2000 Server as a Suse 9.2 box in the next couple of weeks, but I might have to reconsider and go with Gentoo. I was going to buy a gig o' RAM for the box, but it looks pretty spendy.

Today I added another item for AppFuse 1.8 in the roadmap: create an installer using MyJavaPack that can install Ant, AppFuse, MySQL and Tomcat. Basically, give developer's a way to install and start developing with AppFuse in under 5 minutes. Let me know if you're interested in helping out with this.

Posted in Java at Jan 15 2005, 03:30:10 PM MST 4 Comments

Running Cargo from Maven

Yesterday, I integrated Cargo into our application so we could start/stop Tomcat before running our jWebUnit tests. I use Cargo in AppFuse and Equinox - which are both Ant-based. Since we're using Maven on our project, I had to do a bit of futzing to get Cargo integrated into Maven. I prefer to use the Ant tasks from Cargo than the programmatic API because it's nice to run your tests when you start Tomcat manually. If you use the programmatic API, and start/stop Tomcat in setUp()/tearDown() methods - your test will fail if Tomcat is already running.

Below is what I added to maven.xml. With this, we can run "maven test-web" to test our UI with Tomcat running or "maven test-tomcat" to start/stop Tomcat before running our tests. Now I just need to figure out the best way to configure the proper port in my jWebUnit test. I'll probably put it into project.properties and the read the value as part of my test. I've also included a "deploy" goal in this example to demonstrate an easy way to deploy to Tomcat.

    <property environment="env"/>
    <property name="maven.tomcat.home" value="${env.CATALINA_HOME}"/>

    <!-- deploy the directory created by war:webapp to tomcat/webapps -->
    <goal name="deploy" prereqs="war:webapp">
        <copy todir="${maven.tomcat.home}/webapps">
            <fileset dir="${maven.build.dir}">
                <include name="${pom.artifactId}/**"/>
            </fileset>
        </copy>
    </goal>

    <goal name="test-tomcat" prereqs="war:war"
        description="Starts Tomcat, runs jWebUnit tests, stops Tomcat">

        <taskdef resource="cargo.tasks" classpathref="maven.dependency.classpath"/>

        <cargo-tomcat5x homeDir="${maven.tomcat.home}"
            output="${maven.test.dest}/cargo.log" action="start" >
            <war warFile="${maven.war.build.dir}/${maven.war.final.name}"/>
            <configuration dir="${maven.test.dest}/tomcat5x">
                <property name="cargo.logging" value="high"/>
                <property name="cargo.servlet.port" value="8280"/>
            </configuration> 
        </cargo-tomcat5x>
        
        <attainGoal name="test-web"/>
        
        <cargo-tomcat5x homeDir="${maven.tomcat.home}" action="stop"/>
    </goal>

    <goal name="test-web" prereqs="test:compile" description="Runs JUnit tests">

      <taskdef name="junit"
        classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>
      
        <mkdir dir="${maven.test.reportsDirectory}"/>
        <junit printsummary="no" errorProperty="test.failed" 
            failureProperty="test.failed">
            <classpath>
                <pathelement location="${maven.test.dest}"/>
                <pathelement location="${maven.build.dest}"/>
                <path refid="maven.dependency.classpath"/>
                <path location="web"/>
            </classpath>
            <formatter type="xml"/>
            <formatter type="brief" usefile="false"/>
            <batchtest todir="${maven.test.reportsDirectory}" if="testcase">
                <fileset dir="${maven.test.dest}">
                    <include name="**/*${testcase}*"/>
                    <exclude name="**/*TestCase.class"/>
                    <exclude name="**/*$*.class"/>
                </fileset>
            </batchtest>
            <batchtest todir="${maven.test.reportsDirectory}" unless="testcase">
                <fileset dir="${maven.test.dest}">
                    <include name="**/*WebTest.class"/>
                </fileset>
            </batchtest>
        </junit>

        <fail if="test.failed">
          Unit tests failed. For error messages, check the log files in
          ${maven.test.reportsDirectory}.</fail>
    </goal>

Posted in Java at Jan 15 2005, 02:15:05 PM MST 2 Comments

Being in the office is like being on vacation

Ever since June of last year, I've worked out of my house. I had a couple of different clients, but none of them required I go to their office - so all my work was remote. I'd done this before - in fact all of 2002 I worked out of our house in Morrison. Working at home has its perks: no need to get dressed, fast equipment/network, seeing the family more and highly flexible hours. It also has its downsides. The biggest downside I'm finding is you actually have to work all the time. For the most part, when I worked from home, I wrote code 8 hours+ per day. Sure I'd read blogs and have a conference call every now and then, but for the most part, I was working and thinking the entire time.

After being in an office environment for the past 4 days, I'm finding it's like being on vacation. In an office environment, you typically have meetings. In meetings, you don't really need to think - you just sit their and participate. No coding, no problem solving, just good ol' human interaction and communication. Not only that, but the team I'm on is a great group of guys and I feel like I've been working there for years. Stuff that used to take me 2 days to figure out now takes a couple of hours with a team member's help. Furthermore, since we all have similar interests - there's a fair amount of water-cooler talk. The part I really like is the comradery. You know the kind - where guys insult each other to no end and both parties are laughing the whole time. I can't tell you how many times I've sat in my cube and laughed my ass off while these guys take jabs at each other. Downtown Denver

Of course, my perspective could be scewed. I've been working on my Mac all week, which Powerbook owners know is a pleasant experience. It may be slow, but I'm paid hourly, so I don't mind too much. Oh yeah, and the best part? I got a window seat. I can see out over the city as well as the mountains. Life is good in downtown Denver these days.

Posted in General at Jan 13 2005, 11:04:24 PM MST 5 Comments

Installing Jetspeed 2 and deploying Struts/JSF Portlets

One of things we're moving to on my current project is portlet development. The client has a bunch of apps they want developed and it makes a lot of sense to develop them as portlets and deploy them in a portlet container. Because of this, we spent some time this week mucking around with Jetspeed-2. Bruce and I figured out how to install it, and then I did a bit of work with Equinox to deploy the Struts and JSF versions as portlets.

I didn't get equinox-struts or equinox-jsf fully functioning in Jetspeed, but I did get them to deploy and bring up the first page. I expect to do some more work in the next month to get these apps fully functional. In the meantime, I've put together the following tutorials.

If you have any tips on getting JSF or Struts WARs working in Jetspeed, please let me know.

Posted in Java at Jan 13 2005, 08:44:53 PM MST 10 Comments