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.

[ANN] AppFuse 1.8 Released!

This release of AppFuse replaces Container Managed Authentication (CMA) with Acegi Security. Other major features include numerous bug fixes to AppGen and a refactoring of build.xml to use Ant 1.6 features. Eclipse and IDEA project files were also improved so you can easily run tests from within your IDE. A MyJavaPack all-in-one installer was also added so you can download everything you need for AppFuse at once. Eclipse and its plugins were not included in the initial release, but may be in a future release.

If you find any issues, let us know.

Update: You can now see Demos and Videos.

Posted in Java at Apr 29 2005, 08:51:08 AM MDT 11 Comments

Using DWR with Spring and Hibernate

For the past few weeks, I've been developing an application using Struts, Spring, Hibernate and the DWR project for my XmlHttpRequest framework. As you might remember, I used JSON-RPC for Ajax stuff on my last project. I found DWR to be much more full-featured and easier to use. This post is meant to capture some issues I encountered so others won't have to jump the hurdles that I did. For those of you that get bored quickly, here's a movie (QuickTime) of the app's Ajax features.

I've been using version 0.4 of DWR, and I haven't had a chance to try out version 0.5. When I first started using it, I ran into a ThreadDeath problem that was easily resolved by changing a log.debug message to System.out.println. I tried to reproduce this issue yesterday and couldn't, so who knows what that was all about. As far as configuring DWR in your webapp, that's pretty easy to do, and well documented. See the project's documentation or this Spring MVC HowTo.

Here are a few things I remember from my development experience.

  • The examples are great, especially how to dynamically edit a table.
  • When developing, make sure to set the "debug" init-param to "true". This allows you to go to http://location:8080/yourapp/dwr and see a screen that allows you to call methods on your exposed classes.
  • In WEB-INF/dwr.xml, you need to specify a converter for each POJO you want to expose to your UI via JavaScript. I started out by converting a whole package, but found this to be *extremely* slow (we have a package of around 50 DTOs). So I changed it to be only the DTOs I was using. This turned out to take about 30 seconds to do the conversion, and was again unacceptable. The problem turned out to be that the converter was invoking all the lazy-loaded children for each DTO. My final solution was to create a NameValue object and only convert that. Then in my Spring bean, I populate it from DAOs and DTOs. I'm using Spring's OSIVF for Hibernate to ensure that DWR doesn't invoke lazy-loading.
  • I had to override a few of DWR's JavaScript functions in util.js b/c they didn't work for me. I changed showById() and toggleDisplay() to use style.display='' instead of style.display='block' b/c this is what I've always used and block doesn't work that well. I also changed useLoadingMessage() to have a cleaner-looking load message.
  • I used the Fade Anything Technique in this project and found that IE likes to have full 6-digit hex values for colors in CSS rules. The shorter 3-digit hex values simply don't work in IE.
  • Using "test" buttons that only showed up for my username proved to be a great way to test the UI and the Ajax stuff. These buttons called a number of JavaScript functions to drive the UI and wait between invoking different functions using window.setTimeout.

All in all, using DWR was a great experience and I definitely plan to use it more in my projects. The client loves the app - especially since it's wicked fast and seems to work like a desktop app.

Posted in Java at Apr 28 2005, 02:10:26 PM MDT 31 Comments

Java2Html Plugin for JSPWiki causes downtime

There's an annoying thing that currently happens with the Java code on my wiki: selecting code to copy doesn't work in Firefox (try it). Any easy workaround is to use IE. However, I found a solution yesterday after communicating with the author of the Java2HtmlPlugin for JSPWiki. His solution was to upgrade to the latest version (4.1) of the library. I did the upgrade yesterday morning, tweaked a couple of stylesheets and called it good. The copying was working and everything seemed to be fixed.

In the last 24 hours, this site has crashed around 8 times - seemingly every two hours. This is strange b/c it's been up a week at a time prior to that, as well as the fact that my ISP has scripts to restart Tomcat if it's not responsive. The only thing I changed was the java2html.jar, so I'm guessing that was the problem. I backed out the change this morning - and copying with Firefox is going to suck once again. Hopefully that change fixes the stability of this site.

Update: This site crashed 3 times today even after I backed out yesterday's change. It must be something else. It's wierd that it's crashing now after having several weeks of excellent stability.

Posted in Java at Apr 28 2005, 09:48:13 AM MDT 8 Comments

BabyBash - kids love it!

A few months ago, I saw Toby Reyelts' post about a game he wrote called BabyBash. I downloaded it when I first saw it and let Abbie play it. She loved it immediately, and would ask me to play it whenever she saw I was "working" on the computer. Of course, she'd say "Daddy - no working" first, and then say "play Abbie's game?".

Then I lost the link for a couple of months and this conversation turned very sour. A couple of weeks ago, I found the link and vowed to never let it go again. This morning, I gave Jack a run at the game (he's almost 8 months now) and he loved it too! It probably doesn't hurt that they're playing it on a 23" display. ;-)

If you've have small children, you should really let them try this game. Thanks Toby - you rock!

Posted in Java at Apr 27 2005, 04:23:36 PM MDT 11 Comments

[AppFuse] New Committers and 1.8 Status

This morning, Nathan and I invited Ben Gill and Sanjiv Jivan to join us as Developers on AppFuse. Both of these guys have been answering a lot of questions on the mailing list, submitting patches, and documenting things on the wiki. In my opinion, developers that write documentation and help other users are the most valuable. Ben and Sanjiv have agreed to join the project - welcome aboard guys!

In AppFuse 1.8 news, I'm almost there, but not quite. I did a whole slew of refactoring to the Ant build process so that macrodefs replaced many targets, and imports are now used where appropriate. I saw a drastic improvement in execution time after doing the macrodef conversion. The reason I didn't release last week is because I got caught up in refactoring some things to make it possible to run JUnit tests in both Eclipse and IDEA. The good news is I got it all working - the bad news is it screwed up a number of the extras/* install tests. If I can't fix everything in a couple more hours of work, I'll likely back out my changes and simply document the process. I anticipate I have (realistically) 8 hours of work left before a final release. I'm still hopeful I can have it done this week.

Posted in Java at Apr 26 2005, 04:31:33 PM MDT Add a Comment

The back-to-work blahs

Last week I had a really good time at the MySQL Conference. I hung out with some extremely smart folks and learned a lot about various things, such as the Dvorak Keyboard Layout, why James Duncan Davidson hates Ant and why we have Session and Entity Beans (two companies couldn't agree). I spent way too much time working on AppFuse and trying to get the 1.8 release out (it's close, hopefully this week). I also did a 1/2 day seminar on Spring, AppFuse and Comparing Web Frameworks for a company in San Francisco - which was fun.

All of this techno-fun was quickly forgotten when Julie flew in on Friday and we headed down to Cambria, CA for a fun weekend of wine-tasting. Now I'm back at work with many-a-deadline and 81 starred messages in my GMail account. Last week, I realized that doing the open-source and Spring Live stuff is easily a full-time job. The best solution I can think of at the moment is to View Starred Messages » Select All » Delete, followed by ignoring all the e-mails I receive for the rest of the week. I'll try not to do this, but it sure is tempting. ;-)

Someone asked me last week how I manage my time effectively and get everything done. The truth is I don't. I simply stay up late, sleep little, or steal weekends away from my family. Tonight, I expect to spend 4+ hours answering e-mail and doing edits for Spring Live. Hopefully I can catch up and get AppFuse 1.8 released before my parents show up on Thursday night.

Posted in General at Apr 25 2005, 02:19:00 PM MDT 4 Comments

JSF needs better tools

In general, I don't like the fact that JSF is designed for tools vendors. However, after seeing a Visual Studio .NET 2005 demo - I can understand why that's Sun's motivation. Visual Studio is *very* cool and seems to greatly simplify ASP.NET development. That's why it's disturbing to see Why do JSF tools suck so bad?.

If the JSF Tools are going to suck (compared to Visual Studio), why don't we just make it more developer-friendly (instead of being so tools-friendly)? Of course, the better solution is to make the tools better, but that doesn't seem to be happening. Maybe we should just try to get Visual Studio to support JSF. ;-)

Posted in Java at Apr 19 2005, 09:38:07 AM MDT 14 Comments

The Color Schemer Gallery

I've been using Color Schemer for a couple of years now. As a result, I'm signed up for their mailing list. Today they announced a cool new feature on their site:

Sample color scheme from the GalleryColor Schemer Gallery is a brand new online community where Color Schemer users can share and manage color schemes created with Color Schemer.

Now finding the perfect color scheme is as easy as browsing the Color Schemer Gallery!

» Show me more color schemes!

You have to purchase Color Schemer Studio in order to import these locally, but I'd say it's worth $50 if you're color-matching challenged.

Posted in The Web at Apr 19 2005, 08:39:14 AM MDT 2 Comments

At the MySQL Conference in San Jose

I arrived in San Jose at 10:00 this morning to give a 3-hour tutorial on developing test-driven webapps with Spring and Hibernate [download PDF]. This was just a fancy name for developing webapps with AppFuse, but the session seemed to go over pretty well nevertheless. In the first half of the class, there were a couple of sleepers, but I cranked down the A/C for the second half and everyone stayed awake (although some were shivering). I never thought I could ramble on for 3-hours, but it wasn't that hard. I did end up doing mini-presentations on Spring and Comparing Web Frameworks, but all in all, I think it went pretty well. Very few people in the room had heard of any of the Java web frameworks, and only 6 were familiar with Spring and Hibernate. It was a tough crowd, but AppGen's code generation (hopefully) showed it's easy to create CRUD-based webapps with AppFuse. Note to self: make a video of that.

I have a free pass to the MySQL Conference, but I doubt I'll attend many sessions. I have a lot on my plate for AppFuse 1.8, Acegi integration into Roller, and some updates for Spring Live. It should be a good week, hopefully I'll get a lot done. This weekend should be awesome - Julie shows up on Friday for our 5-year anniversary party.

The best part of the conference so far? Talking shop over beers with the locals (crew from c|net and AppFuse user Phil Hershkowitz).

Posted in Java at Apr 18 2005, 09:34:01 PM MDT 1 Comment

How do we bake Ajax into Struts and Spring MVC?

I see a trend happening here. The next version of WebWork, as well as Tapestry and JSF are all embracing Ajax technologies. By "embracing", I mean they're not only using them, but they're making it easier for us to use them.

After using XmlHttpRequest in my last two projects, I think this is a must for Struts and Spring MVC as well. The technology is very cool and customers absolutely love it.

The question is how do we bake it in? WebWork makes it easy because its tag libraries are backed by customizable Velocity templates. With Struts and Spring MVC, it seems the best way would be to use tag libraries, but maybe there's better alternatives. Do they each need an AjaxAction/AjaxController or something that allows DWR-type stuff?

What are your thoughts? You might argue that using DWR should suffice, but w/ everyone else (even Rails) baking it into the framework - I see no reason why Spring MVC and Struts shouldn't do the same. You are using these frameworks to develop kick-ass UIs aren't you?

Posted in Java at Apr 15 2005, 06:20:28 AM MDT 13 Comments