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 "free sex movies for men non blog". 1,226 entries found.

You can also try this same search on Google.

Comparing Web Frameworks: Time for a Change?

I first came up with the idea to do a "Comparing Web Frameworks" talk in 2004. I submitted a talk to ApacheCon and it got accepted. From there, I outlined, created sample apps and practiced this talk before ApacheCon. Believe it or not, that was my first time speaking in front of a large audience.

Historical note: October 2004 was a pretty cool month - I discovered Rails and Roller had a 1.0 release candidate.

When I created the presentation, it was in large part due to all the WebWork and Tapestry folks harassing me on this very blog. I started using Struts in June 2001 (the same month 1.0 was released) and had used it successfully on many projects. Part of the reason this blog became so popular was I posted lots of tips and tricks that I learned about Struts (and its related project) while using it. After a while, the noise became too heavy to ignore it - especially after I'd tried Spring MVC. So in an effort to learn more about the the other frameworks, I submitted a talk and forced myself to learn them. It seems to have worked out pretty well.

With that being said, I think it's time for a change. The reason I originally wrote this was to educate developers on how the top Java web frameworks differed and encourage developers to try more than one. A while later, I realized there's different tools for different jobs and it's not a one-size-fits-all web framework world. It's not a component vs. request-based framework world either. There's lots of options now. When I've delivered this talk earlier this year, I've always felt like I've left quite a few frameworks out. The solution could be to add more and more frameworks. However, I don't think that's a good idea. The talk is already difficult to squeeze into 90 minutes and it's unlikely that adding more frameworks is going to help.

The change I'd like to do is to reduce the number of frameworks down to (what I consider) the top web frameworks for deploying to the JVM. What are those frameworks? IMHO, they are as follows, in no particular order:

  • GWT-Ext
  • Wicket
  • Grails
  • Flex/OpenLaszlo
  • Seam
  • Struts 2

The RIFE, Tapestry and ZK folks can start bitching now. Sorry - less frameworks make for a more interesting talk. Maybe I'll add you in the future and I can ask the audience which ones they want compared then we can choose four and go from there. Why don't I mention Spring MVC? Because I think Struts 2 is easier to learn and be productive with and I also like it's more open and active community. I've written applications with both and I like Struts 2 better. As for Flex vs. OpenLaszlo, I'm somewhat torn. It seems like learning Flex is going to be better for your career, but it's likely useless without the Flex Builder - which is not open source. However, at $250, it's likely worth its price. I know the Picnik folks used Flex for their UI - I wonder how much they used Flex Builder in the process?

What do you think? Are these the top web frameworks for JVM deployment today? The next time I give this talk is this Thursday at ApacheCon. I may try to re-write my talk and then give the audience a choice of old vs. new. The downside of doing the new talk is I won't have time to write apps with GWT, Flex or Seam. Anyone care to post their top three pros and cons for any of these frameworks?

Posted in Java at Nov 12 2007, 04:46:56 PM MST 50 Comments

Introducing the Cadillac named Snow White

Diamond White Today I completed something I've been hoping to do for a couple months now - I bought a new car! I started looking a few weeks ago and today I let Janet the Used Car Sales Lady talk me into buying a 2004 Cadillac Escalade. I was planning on buying a used Yukon, but took a fully-loaded one for a test-drive this morning and found it to be sluggish and kind of a rough ride. Since I like the look of the Escalade, I decided to test-drive one of those this afternoon. 2 hours later, I'd made a screaming deal that I couldn't pass up. I wanted the shorter SUV, but ended up with the longer one. Oh well, I went from a car to an SUV to get more room so I don't feel too bad.

The main reason I wanted to get an SUV (and a big one at that) was because I've found my Honda Accord to be too small to cart the kids around in. While it works, it's tough to pack any sort of gear (bikes, skis, etc.) with us. I know, I could have boughten a roof rack and taken my 12" subs out of the trunk to free up some room, but I was ready for a truck. After the Blizzard of 2006, I didn't want to get snowed in for days at a time. Also, the kids and I got Winter Park/Copper Ski passes so I want to be able to take them skiing a lot this winter.

Disclaimer: I realize this is about the least green thing I could do and I'm not helping the environment at all. My only justification is 1) I had a very low carbon footprint the first 16 years of my life growing up at the cabin with no electricity or running water and 2) I don't really drive a whole lot. I averaged around 7,000 miles a year on my Honda - having only 36,000 miles after 5 years. With this one, I'll probably drive it a fair bit this winter and hardly drive it at all next summer and beyond. By then, hopefully the Bus is done and I can cruise around town in the sweetest ride I've ever owned.

As for the name "Snow White" - that was Abbie's idea. We'll see if it sticks.

Update: I forgot to mention one of my favorite features - a direct iPod hookup. I can navigate playlists from the stereo in the car. The display is only limited to 8 characters, but it's a lot better than broadcasting over FM.

Posted in General at Nov 10 2007, 10:34:06 PM MST 9 Comments

Upgrading AppFuse to Spring 2.5

Last night, I spent a few minutes upgrading AppFuse to Spring 2.5 RC1. According to InfoQ, Spring 2.5 is a drop-in upgrade for Spring 2.0. However, if you're using Maven, it's not quite that easy. The good news is it is easy, you just need to change your pom.xml a bit. The steps I used to upgrade AppFuse are listed below:

  • Add a repository for Spring's milestone releases:
    <repository>
        <id>spring-milestone</id>
        <url>http://s3.amazonaws.com/maven.springframework.org/milestone</url>
    </repository>
    
  • Change artifactId of "spring-mock" to be "spring-test".
  • Change version to be 2.5-rc1.

At this point, if you're using "spring" as your artifactId (instead of the smaller fine-grained dependencies), you'll likely get the following error in a Spring MVC application:

java.lang.NoClassDefFoundError: 
org/springframework/web/servlet/handler/AbstractUrlHandlerMapping

This happens because Spring MVC is no longer included in the uber spring.jar. You'll need to add a dependency on "spring-webmvc" to solve this problem. Unfortunately, this JAR is dependent on the fine-grained modules, so you may have to modify your pom.xml to depend on the fine-grained modules - or exclude them all from spring-webmvc.

The good news is Spring has excluded all the invalid commons-logging dependencies for you so you don't have to anymore.

After getting all the dependencies straightened out - I ran the integration tests:

org.springframework.beans.NotReadablePropertyException: Invalid property 
'fileUpload' of bean class [org.appfuse.webapp.controller.FileUpload]: Bean 
property 'fileUpload' is not readable or has an invalid getter method: Does the 
return type of the getter match the parameter type of the setter?

Looking at uploadForm.jsp, I'm guessing the problem happens because of the following code:

<spring:bind path="fileUpload.file">
<input type="file" name="file" id="file" class="file medium" value="<c:out value="${status.value}"/>"/>
</spring:bind>

Confirmed - changing the "path" attribute to "file" fixes the problem. I also found out that setting the "value" on an <input type="file"> doesn't work, so wrapping the field with <spring:bind> doesn't make a whole lot of sense anyway.

To conclude, it doesn't look like the first release candidate of Spring 2.5 is exactly a drop-in upgrade for Spring 2.0, but it's pretty darn close. I'm sure by the time it's released, it will be. I'd encourage you to try 2.5 in your Spring-dependent projects to see if you find any issues.

Update: I was successfully able to migrate AppFuse from using the uber JAR to fine-grained JARs. However, I ran into a couple issues in the process. The first is that even though I'm including spring-aop in the appfuse-service module, it's not pulled in for the web frameworks (which depend on appfuse-service). Explicitly declaring spring-aop as a dependency for the appfuse-web module fixes this. Secondly, I had to modify my Acegi Security exclusions so it wouldn't include dependencies that no longer exist in 2.5.

<dependency>
    <groupId>org.acegisecurity</groupId>
    <artifactId>acegi-security-tiger</artifactId>
    <version>${acegi.version}</version>
    <exclusions>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-dao</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-remoting</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-support</artifactId>
        </exclusion>
    </exclusions>
</dependency>

Posted in Java at Nov 07 2007, 08:27:20 AM MST 3 Comments

Going to see Fake Steve Jobs Tonight

One of the perks of working at LinkedIn, and being out in Mountain View this week, is I get to attend a talk tonight where Guy Kawasaki interviews Fake Steve Jobs. It's my first trip to the Computer History Museum, so it should be a fun show. If you're not able to make it tonight, it looks like they'll be live streaming the event from the LinkedIn blog.

My only question is - do you think FSJ will act like Jobs or himself? I'm hoping for the former.

Update: That was an awesome event. Thanks to LinkedIn for hosting it and for Fake Steve for the great stories behind his journey.

Update 2: The LinkedIn Blog has videos from the event.

Posted in Mac OS X at Nov 06 2007, 02:41:15 PM MST Add a Comment

Happy Birthday Abbie!

5 years sure goes by quick when you're a parent. It's hard to believe that 1) I started blogging over 5 years ago and 2) Abbie turns 5 years old today. It's pretty cool to be able to look back at previous birthdays: the birthday, #1, #3 and #4. I don't know what happened for #2, but I sure feel bad for not blogging the event.

Congratulations kiddo - you've turned into a beautiful (and awfully smart) little girl.

Pretty Girl

P.S. Don't tell her I called her a "little" girl - she's obviously a "big" girl. ;-)

Posted in General at Nov 05 2007, 12:37:24 PM MST 3 Comments

Roller and Struts 2 BOF at ApacheCon next week

ApacheCon Are you going to ApacheCon in Atlanta next week? If so, you might want to mark your calendar for the Roller + Struts 2 BOF on Wednesday night. It's from 8:30 - 9:30 in "Room 3" (whatever that means) and free beer will be sponsored by Atlassian. Thanks Guys!

Apparently, projectors aren't provided for BOFs, so we are in need of a projector to do a small presentation. If you happen to have a "projector connection" in Atlanta next week, please let me know.

Posted in Java at Nov 05 2007, 08:25:26 AM MST Add a Comment

Google Code for Educators

Google Code for Educators looks like some really great stuff from Google.

This website provides teaching materials created especially for CS educators looking to enhance their courses with some of the most current computing technologies and paradigms. We know that between teaching, doing research and advising students, CS educators have little time to stay on top of the most recent trends. This website is meant to help you do just that.

In the Tutorials area, you will find a set of online tutorials to which you can point students to learn basic concepts in important new technologies, or if you need a refresher.

In the Sample Course Content area, you will find materials such as lecture slides, readings, problem sets and projects that you can download to use in your own course. All these materials are distributed under a Creative Commons license, so you are free to use and modify these materials according to the terms of the license. This area includes sample course content developed by CS Faculty from various universities and Google engineers.

In the Video Lectures area, you will find a set of video-taped lectures from Google Video on our technology areas. These videos are great opportunities for students and faculty to hear directly from some of the current pioneers in high-tech.

In the Tools section you will find a set of tools and resources to help you get started with the material highlighted on the site. This area includes tools developed by Google engineers, as well as links to external resources.

Posted in Java at Nov 02 2007, 11:22:22 AM MDT Add a Comment

My Upgrade to Leopard

By now, you've seen many stories about upgrading to Leopard. Here's mine.

In the past, I would've slapped the DVD in, selected upgrade and prayed for the best. Now I'm older and (apparently) wiser. First, I cloned my hard drive with SuperDuper!. Then I attempted to upgrade. I started the process on Saturday morning and didn't check it until Saturday afternoon. At that point, I was greeted with the lovely blue screen of death. I didn't even bother to look up the problem - instead opting for the clean install.

The next time I checked (Sunday evening), the installation was completed. I registered, clicked through some stuff and started copying files from my backup drive. On Sunday night, I closed the lid on my laptop and haven't used it since. I guess new operating systems don't excite me as much as they used to. Then again, I do have two MacBooks, so I don't really need the Leoparded one.

As far as the lack of Java 6, that doesn't surprise or disappoint me. I'm sure it'll be out in a few weeks. By the time it's released, I doubt any of my clients will have made the leap from Java 5 -> Java 6.

It could be that I'm burned out on technology - or it could be the Rockies and Broncos performance this past weekend has got me bummed. Who knows - the good news is there's lot of trick-or-treating to be done in the next couple of days and I'm sure to cheer up with the kids around.

Posted in Mac OS X at Oct 30 2007, 01:42:39 PM MDT 9 Comments

Xebia Web Framework Contest

I found an interesting blog post today about a contest (English translation) a French company (Xebia) had with some Java web frameworks.

4 teams have developed the same web application, each with a framework (very) different. The frameworks used were:

  • Struts 2
  • Google Web ToolKit
  • Wicket
  • My Faces (JSF)

Overall, I think it's a good summary of the strengths and weaknesses of the various frameworks.

Posted in Java at Oct 30 2007, 09:32:34 AM MDT 8 Comments

Introduction to Grails with Scott Davis at the Colorado Software Summit

Grails According to Scott, today's Java-based web frameworks are partial solutions at best. They're only solving one piece of the puzzle - you still need to manage persistence, deployment, etc. all by yourself.

We're moving into a new era of web frameworks. The expectation now is a full-stack solution. Grails is a fully integrated modern Java web application in a box. It contains Spring, Hibernate, Quartz, Log4J, Jetty, HSQL, JUnit and Ant. You're not limited to using Jetty, you can type "grails war" and create a WAR that you can deploy to any application server. In a single zip/tar, you get the whole thing - including the database and servlet container. You get a lot of good default for free, but you're not limited to those defaults.

What does "modern" in a framework mean? It means it uses Convention over Configuration - Grails autowires components together based on naming conventions. Struts 1.x uses Configuration over Configuration - the more XML the better.

The Wisdom of Crowds - why are the many smarter than the few? What is the wisdom of crowds when it comes to web frameworks. Struts is the wisdom of crowds when it comes to web frameworks. It's based on sound principles (MVC) and was written by Craig McClanahan. He was the architect of "Catalina" Tomcat 4 and wrote Struts shortly thereafter. David Geary was contributor #2 to Struts. It has a proven track record and has a 60%-70% market share. Struts must be the perfect framework - especially since it has such a great pedigree.

So what's wrong with Struts?

  • It's 7 years old
  • It's verbose and overly complex (reflective of the EJB 2.x era)
  • Splintered community: Craig moved on to JSF -> created Shale, then the WebWork merger
  • While Struts 1.x was an unqualified success, Struts 2.x can't seem to build that critical mass - it can't seem to reach The Tipping Point like Struts 1.x did

The Recipe for a Tipping Point: Contagiousness / viral, tiny "tweaks" to a proven model can yield big, disproportionate effects, the rise is not "slow and steady" - the effect is dramatic and immediate.

Ruby on Rails won the hype award. It's largely worth the hype, but it's not revolutionary - it's evolutionary. It has tiny tweaks to the proven MVC-driven approach: Convention over Configuration, Scaffolding and Unified Technology Stack.

The one thing that Rails is lacking is Java support. Grails, on the other hand, offers the same experience using known, proven Java solutions.

  • Rails => "replacement"
  • Grails => "upgrade"

Scott drank the Rails Kool-Aid for a while and enjoyed it, but found it difficult to switch from Ruby in the morning to Java in the afternoon. With Grails, he doesn't have to do as much context switching, as well as all the Java libraries are available - the ones you know and love.

You can drop groovy.jar into your classpath and write Groovy code. One nice thing about Groovy is you can rename your existing .java files to .groovy and they'll work just fine. Included Ajax support: Script.aculo.us and Protoype as well as YUI. YUI is battle-tested since it's used by Yahoo and very well documented. You can use "grails install-dojo" to install the Dojo toolkit. Grails has a wealth of plugins available at http://grails.org/plugins.

Now we're going to crack our nuckles and build some code - slides are over.

 grails create-app conference
 cd conference
 grails create-domain-class Speaker (add some fields)
 grails generate-all Speaker
 grails run-app

The impressive things about this set of commands is I was able to 1) download Grails and 2) run all these commands at the same time that Scott did. I was definitely impressed (I knew I would be). Auto-scaffolding - you can get the same thing as "generate-all", but it generates controllers and views at runtime in-memory. All you need to do is create a domain object (i.e. Talk) and then create a TalkController that has the following line in it:

def scaffold = Talk

As a test, I tried this at the same time that Scott did and got the following error. It looks like Grails/Jetty isn't smart enough to pick up new classes as they're added.

[263102] commons.DefaultGrailsApplication Class not found attempting to load class Talk
java.lang.ClassNotFoundException: Talk
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)

Grails comes with a number of environments. Dev (the default) auto-reloads changes to Controllers, Views and even the Model (this is helpful for rapid development). Prod loads all items statically for maximum performance. To change the environments - you can change DataSource.groovy.

For some reason, adding/removing some properties on my Talk object and my application hasn't been the same since. Now when I try to access my TalkController, I see the following stack trace:

org.springframework.orm.hibernate3.HibernateQueryException: could not resolve property: difficulty of: Talk; nested exception is org.hibernate.QueryException: could not resolve property: difficulty of: Talk
	at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:640)
	at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
	at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:378)
	at org.springframework.orm.hibernate3.HibernateTemplate.executeFind(HibernateTemplate.java:342)
	at org.codehaus.groovy.grails.scaffolding.DefaultScaffoldDomain.list(DefaultScaffoldDomain.java:112)

I asked Scott about this error and he proved that removing properties from domain objects should work. I told him restarting Jetty didn't fix the problem and he suggested dropping the "Talk" table and letting Grails re-create it. Unfortunately, I have no idea where this database is, so that's difficult to do. Doh - now I realize what was causing the problem. Before I dropped the "difficulty" property, I had clicked on the column and that property was still referenced in the URL. When I'd refresh the browser, the stack trace occurred. I don't know if I'd consider this a bug or not.

dbCreate = hibernate.hbm2ddl.auto is used. When in development create-drop is used. In production and test environments, it uses update and saves the data between restarts.

You can turn off Hibernate's automatic schema alteration by commenting out "dbCreate" line in DataSource.groovy.

To run your application in Tomcat instead of Jetty, you can run "grails war" and copy the WAR to Tomcat. The WAR is created with the production environment by default, so you may need to pass in arguments or set environment variables if you want the WAR created in dev mode.

At this point, my battery died. Scott continued to cover how to order form elements (when using scaffolding) with "static constraints" and how to add validation rules. It was an excellent presentation and Grails definitely looks like a really cool web framework. The best part is I learned most of what you need to know to use it - in an hour!

I might have to try Grails soon - I love the concept of Life above the Service Tier and Grails would work nicely for serving up REST. I think YUI, GWT-Ext and Flex are probably the best frameworks for developing a SOFEA client. The question is - when using YUI, how do you download all pages in the application at once?

Posted in Java at Oct 25 2007, 07:03:42 PM MDT 19 Comments