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.
You searched this site for "appfuse". 771 entries found.

You can also try this same search on Google.

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

[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

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

Why Wicket looks cool

I like the looks of Wicket for a couple of reasons - without even using the framework yet.

  • Its project homepage looks good. If you're using a Java web framework, chances are you're developing UIs too. If you don't know how to make sites look good - it's time to find a new line of work IMO. Of course, learning how to make good-looking UIs is another option. ;-)
  • Its Wicket Stuff project. It provides Hibernate, fValidate and Spring integration. It also appears to provide an option to use Velocity for your templates. I'm not sure what the Velocity integration provides - since HTML templates (ala Tapestry) should do everything that's needed.

What I don't like about the project:

  • The Buzz page has a quote that's (apparently) from this site. Unfortunately, it looks like I said it - which I didn't.
  • There's no books being written about it. If it's really that good - where's the books? Ruby on Rails will have 3 by the end of this year. Any good framework should inspire books to be written about it.
  • The Wicket Stuff project has no documentation. Javadocs don't cut it. Tutorials are king.

I hope this project succeeds - Tapestry needs some competition and I don't think JSF is providing it. If JSF adds HTML Templates (or I figure out how to use Java Studio Creator to manage an AppFuse+JSF project), that's a different story.

Posted in Java at Apr 14 2005, 08:37:03 AM MDT 12 Comments

Using Ivy in AppFuse

I'll admit, the thought of not checking in JARs to AppFuse's CVS is intriguing. With Ivy, I think I could pull off the current setup, plus a dynamic-downloading system. By current setup, I mean that the JARs are distributed in your "lib" directory and you can build your app w/o downloading any dependencies. I like this because I can develop AppFuse and not worry about my internet connection.

Dion doesn't get my love for checking in JARs. The main reason I do it is because it takes me a less time to download a new release and check it into CVS than it takes me to find that same release in Maven's Repo. Case in point: Hibernate 3.

I love the idea of Ivy, and mockhaug makes it sounds great, but I don't want to have to create a bunch of metadata whenever I want to use something like Hibernate 3. Then again, if Ivy is ever going to catch on, someone has to do it.

In conclusion, I'm still not convinced I should integrate Ivy into AppFuse - sounds like maintaining and uploading dependencies would be a lot more work than just checking in JARs. If there was a person responsible for creating Ivy metadata every time a new release came out, I might think different.

Posted in Java at Apr 13 2005, 02:19:21 PM MDT 6 Comments

Maven 2 Alpha - looking good!

I saw that the Maven 2 Alpha was released today and decided to give it a spin. The two features in Maven 2.0 that look compelling to me are 1) speed and 2) transitive dependencies. I've been using Maven 1.x on my current project since January and I still don't like it. Why? It's dog slow on my PowerBook (but tolerable on my Windows box) and you have to specify a shitload of dependencies when developing an app with Struts+Spring+Hibernate.

Maven 2 looks good, and it does seem to startup as fast as Ant (at least on Windows). Just typing "m2" completes in about a second, and so does typing "ant". Typing "maven" takes about 3 seconds (even though it reports it only took 1 second). I look forward to seeing Maven 2 evolve. I wonder if we should rewrite our POMs for Maven 2 (we current have 11 sub-projects)? We'd probably be a pretty good test-bed, but I don't think Maven 2 supports all the 1.x plugins - does it?

I doubt I'll use Maven 2 with Equinox or AppFuse this year - mostly b/c I don't expect it to be released until 2006. I do like the looks of Ivy and I've considered re-writing AppFuse's monstrous build.xml file using JAM. If I were to use Ivy, I think I'd still release with all JARs in a local "lib" directory. The nice thing about Ivy is it would give users the option of checking JARs into source control (currently, it's required).

Even after using Maven for several months, I still like local JARs better than downloading. It does make a lot of sense in a multi-project environment though.

As for JAM, I don't like it for two reasons: 1) it uses the non-transitive dependency listing like Maven 1.x and 2) it requires you install JAM and set a $JAM_HOME. I'd prefer to keep AppFuse to one build tool - Ant or Maven (or both).

I suggested a large refactoring of the build process (and collapsing of the source trees) for AppFuse 1.9, but it was rejected by users for the most part. Their opinion: the build process works great, we like it - work on other stuff that's more important (code generation, tools support, etc.). Another thing that's suprised me about AppFuse users is the relatively small number of folks that have requested support for appservers other than Tomcat. To date, I don't think I've had a single Resin or Orion request, but I've had plenty of WebLogic, WebSphere and Sun App Server requests. The most compelling reason to use JAM for building/deploying/testing AppFuse is for its server support, but if I don't need it, why add the complexity?

I guess some things just work, and there's no reason to fix them if they aren't broken. Maven 1.x is not one of those things IMO. It's good to see the improvements coming in Maven 2.

Posted in Java at Apr 08 2005, 01:52:10 PM MDT 4 Comments

Useless Statistic

Speaking of statistics, here's some useless ones:

The first stat is pretty useless, but the 2nd is pretty cool considering there hasn't been a release since December.

Posted in Java at Apr 08 2005, 06:16:19 AM MDT 5 Comments

It's time for some productivity

Just last night I was wondering how I was going to finish up AppFuse 1.8 and Spring Live's April update in the next 1 1/2 weeks. This morning, I got up early (5:00 a.m.) to get back to work on Spring Live, and found that Julie was already up. She was fed up with the fact that Jack was coughing up a storm and both kids are still sick. They've been sick off-and-on since January (but mostly on), and she's had enough.

Julie tooks Jack to the doctor a month ago and his recommendation was a warm and humid climate. She asked him, "like Florida?" - to which responded, "Yes! That's a great idea!" Since then, she's bought a humidifier, taken showers with Jack every morning and even hit him with the nebulizer a few times. No dice, he's still coughing and wheezing. At 5:00 a.m. this morning, she was fed up and said "I'm going to Florida." 20 minutes later, she'd bought her tickets and we left for the airport around 6:30.

While I'll certainly miss everyone, it's a golden opportunity for me to work on AppFuse and Spring Live and get caught up this weekend. Of course, I have to work an extra day in the mix to pay for the (spendy) flights, but it's nice being a contractor and having that as an option. Now the problem is I find an empty house often leaves me with little motivation. I tend to enjoy renting movies and going to bed early when the family is gone. Of course, with DU being in the Frozen Four tomorrow (and hopefully Saturday) - there's even more motivation for more fun and less work.

Regardless of the motivation I have to take part in my extra-curricular obligations (AppFuse and Spring Live), it's nice to know I have a great opportunity to work on them this weekend. Staying up late to work on this stuff just isn't any fun.

Posted in General at Apr 06 2005, 04:10:05 PM MDT 7 Comments