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.

It's good to be home

After a week and a half on the road, it's awesome to be home. JavaOne was a great time, but pretty exhausting too - and I didn't even go to any sessions! After attending the Ajax Experience, all the JavaOne topics seemed like old news. Actually, I was motivated on Thursday, but when I tried to register using the schedule builder, all sessions were full. Hot topics of the week were GWT, Avatar in JSF and Java EE. I do hope to checkout GWT sometime, but it'll probably take me a month or two. I'm booked at clients for the next couple of weeks, and after that I'd rather just enjoy the summer than work 12-hour days. As far as AppFuse 1.9.2, that's high on my list - but it'll probably take me a couple days to complete since I'll be doing it at night.

The Tangosol/SolarMetric party didn't disappoint, and Geronimo Live was a smashing success. There's a bunch of pictures (and video) posted on the Virtuas Travels Blog.

I arrived home Friday afternoon and the fun hasn't stopped. Softball game yesterday, followed by 3 BBQs and a night of playing with the kids on a friend's swingset. Today, we went to the 12th Annual VWs on the Green show. Unfortunately, it was 90°F, so we didn't last long. I'd like to say I got some good ideas for my bus, but in reality I chased Abbie and Jack around the whole time. Below are some pictures from the show today. As for my bus, it's in the shop, but no work has begun. I need to visit them this week to get something in writing so they can start doing body work.

Giant Bug and Jack Can we run up the hill Dad?

Thing with Tracks Kids love buses

Jack is pooped Nice black and white

Nice Porsche Wheels Abbie and Jack

Posted in General at May 21 2006, 03:10:40 PM MDT 2 Comments

Wine Country

While last week's Ajax Experience was a good time, it didn't hold a candle to the fun I had this weekend. I closed down the Thirsty Bear and Kate O'Brien's Friday night with Mats, Carlos and a few others. Saturday morning, Mr. and Mrs. Crazy Bob picked me up and we headed up to Napa Valley.

hans fahden The first place we headed was Hans Fahden, which is a small winery in the northern part of Napa Valley. It was strange at first - no one was there, not even someone to serve us. Then a guy showed up, grabbed a bottle of wine and proceeded to give us a tour of the place. For the next hour, we toured his "wine cave" and beautiful gardens. Whenever our glasses were empty, he filled them up. The owner has spent the last 30 years building a spectacular garden with trees, flowers and even a couple of ponds. The gardens are so beautiful now that they've become a hotspot for weddings and have hosted over 800 since they started doing it. It was one of the most beautiful places I've ever been and we couldn't have asked for a better host.

From there, we went to another private tasting, where they kept our glasses filled until we refused. At this point, my toungue could no longer taste the wine, but my brain assured me it was good. After hitting one more winery and sweet-talking our way in (they were closing), we headed back to our hotel to meet up with Cameron and the Tangosol crew.

We had an awesome dinner with several more bottles of wine, then headed to the bars in downtown Santa Rosa. Two hours later we called it a night, much to Crazy Bob's chagrin. He's a big fan of downtown Santa Rosa. Yesterday we drove back to a beautiful day in San Fransisco. I spent most of the day working on AppFuse 1.9.2 (preview, status) and while I didn't finish, I did manage to get a good night's sleep.

This morning, I checked into The W, which is right across the street from JavaOne. The location rocks, the accommodations are swanky, and life doesn't get much better. This afternoon I have meetings with customers, followed by some AppFuse development, followed by JavaOne festivities.

As far as missing Mother's Day (yesterday) and Julie's birthday (Saturday), I'm still not in the dog house. Julie and kids have been living it up in West Palm Beach and having a great time. Today they're heading to Disney World. Sounds like they're having more fun than I am. ;-)

Posted in General at May 15 2006, 10:43:31 AM MDT Add a Comment

Ajaxian Faces with David Geary

David wrote both Graphic Java Swing and Core JavaServer Faces (with Cay Horstmann). Both of these were best sellers on Java component frameworks. Not only that, but he's fun to talk to and lives just south of me in Colorado.

Agenda: Ajaxian Faces Essentials, Roadmap, Form Completion, Realtime Validation, Ajaxian Components, Ajax with Shale and Prototype.

Enterprise Java and Ajax: you invoke a URL from the client (XHR), then handle the URL on the server. This handling is usually done by a servlet, filter or a JSF phase listener. These return HTML or XML to the client. Then the client merges the response into the DOM on the client.

JSF and Ajax: JSF is an excellent framework for Ajax. Why? Because of its component model: GET and POST requests are supported and it has custom components and renderers. Furthermore, JSF has lifecycle and event handlers - phase listeners and allows complete control over the lifecycle.

Common Ajaxian use cases: form completion, realtime validation, polling (progress indicators, realtime search, etc.), ajax components and frameworks. In this talk, we'll be covering JSF (POSTs and GETs), JSF and JavaScript, how to control the JSF lifecycle, JSF client ids vs. component ids, accessing view state, and many other things.

Arm yourself with tools: Firefox with the Web Developer Toolbar. Most helpful features: outlining block elements and DOM inspector. Debuggers on client and server: IDEA on the server, Venkman on the server.

Good Resources: Java EE Blueprints, Ajax Magazine and MSDN.

JSF and JavaScript: The HTML component tags have all the event handlers built-in: onclick, onblur, onfocus, etc.

<h:form id="form">
    <h:inputText id="name"/>
    ...
</h:form>

In the above example, the component id is "name" and the client id is "form:name". To do minimal Ajax with JSF, you can use a non-Faces object to handle the Ajax requests with a servlet or filter. All you really need to know is how to reference client ids vs. the ids you code into your view templates.

Realtime validation: to do this, you need access to the view state. Ajax will fire a component's validators, invoke a phase listener (after the Restore View phase), POST a request with XHR and utilize client-side state handling. A typical component tree for a form consists of a UIViewRoot, an HtmlOuputText (instructions for form) an HtmlForm and an HtmlPanelGrid that contains all of the input components.

The JSF Lifecycle: Restore View -> Apply Request Values -> Process Validations -> Update Model -> Invoke Application -> Render Response. You have to do a post with JSF, otherwise the view state won't be available.

To register a phase listener, you merely declare it in your faces-config.xml file. There's a PhaseListener interface that defines 3 methods: getPhaseId(), beforePhase() and afterPhase(). In this example, getPhaseId() returns PhaseId.RESTORE_VIEW and beforePhase() isn't implemented; afterPhase() is used. David then checks for an "ajax" parameter. If it's sent in the request, he grabs the component to validate and invokes all its validators. One of the nice things about JSF is you can modify your client-side components on the server-side. You can also use JavaScript on the client-side to grab the hidden client-side state-saving field and send it with an Ajax request to maintain state.

JSF Ajax Components: To create JSF Ajax components, you'll want to put your JavaScript into a separate file. In the component's renderer, you'll write a <script> tag that uses a JSF page as its "src" element. Then you use a PhaseListener that looks for the URI invoked by "src" and handle it appropriately. Now David is showing us how you need to create a component, a Tag and a Renderer to create an Ajax component. The Tag and the Renderer write out JavaScript functions that do the magic stuff. Finally, you'll need to create a JavaScript file that contains the functions to be called. At this point, ragged on Geary a bit for creating a simple component with 3 Java classes + a .js file.

Rather than writing all this low-level JavaScript code yourself, you can simplify development with JSF and Ajax by using Struts Shale. Features of Shale include.

  • Web flow
  • Remote method calls
  • Tiger extensions
  • Integration with: Spring, Tiles, JNDI
  • View controllers
  • Testing framework
  • HTML views (a.l.a. Tapestry and Facelets)

David gave a quick preview of Shale and showed how much easier it makes Ajax. Basically, you give a specialized URL on your client - and using a syntax of "dynamic/managedBeanName/method", it calls that method on the server. Pretty cool stuff, but doesn't seem a whole lot different from what DWR offers for JSF. "Shale is a proving ground for JSF 2.0, hopefully all its add-ons will make it into the next version of the spec." When David says stuff like this, I'm tempted to use Shale in AppFuse for its JSF support - especially since Shale can work with any JSF implementation (1.1 RI, MyFaces or 1.2 RI).

As usual, this was a good talk by David. He's always entertaining and fun to harass. ;-)

Posted in Java at May 12 2006, 06:06:55 PM MDT 3 Comments

Ajax on Rails with Stuart Halloway

There's a number of presentations I'd like to attend during this time slot. In particular, I'd like to attend Testing with Selenium and Simplified Ajax Development in Java with ICEfaces. However, Stuart Halloway is an excellent speaker and I'd rather hear him talk than learn something in another session. Hopefully other attendees blog about the aforementioned sessions so I can still learn something from them.

Agenda: Ajax, Libraries for Ajax (i.e. Prototype and Scriptaculous), Rails and Ruby.

There's probably 100 people in the room. Stuart did a survey of who is using Rails - I'd say the response was about 10%. He also asked who's considering it for future development. The response seemed to be around 25%. I'm sitting in the front of the room, so I probably didn't see the results as well as Stuart did. Regardless, it's interesting to see that most people in the room won't be using Rails, they're merely interested in it (or they wouldn't be in the room, right?).

The best way to play with Rails on Windows is called InstantRails. For OS X, there's Locomotive.

All the demos given during this session are available in the ajax_labs section at codecite.com.

Things we're going to look at: autocomplete, in-place Editing, searching, sorting, expando, drag and drop, sort, server-side validation, client-side validation, and prototype windows (Stuart prefers to call them divdows).

Stuart is talking a lot about how Rails works at this point, model objects, yml files, tests and sample data. One of the things that I find interesting about most CRUD-generation frameworks is they don't take tests into account. Ruby on Rails generates tests, so does AppFuse. If you work on a CRUD-generation project for web development, do you generate tests too? If not, don't be embarrassed, tell us. There has to be a good reason you're not doing this.

Now the audience is struggling with the concepts in Rails, how ActiveRecord works, etc. For example, one guy asked if it's possible to use JDBC with Rails. It's definitely a humorous question, but Stuart handled it quite well without ridiculing the guy. A couple of notes: Rails doesn't work well with stored procedures or composite keys.

Now we're looking at the view layer, in particular a show.rhtml template. It's pretty simple , but not very HTML-ish. Looks a lot like scriplets in JSPs. Autocomplete with Rails is mostly CSS-driven. To use it in a Rails view, you start with the following line of code at the top of your template.

<%= stylesheet_link_tag 'autocomplete' %>

In Rails, when you want to render an Ajax response in a controller, you use the following at the end of your method.

render :layout=>false

This turns off any page decoration. It'd be nice to have something like this in the Java world - so you could turn off page decoration from SiteMesh, Tiles, etc. It shouldn't be hard to implement this in SiteMesh, but it might take a bit of work for Tiles.

Partials are Rails' way of creating fragments that are designed to be populated and returned by Ajax calls. Their naming convention is to being the filenames with an underscore. For example <%= render :partial=>'search' %> looks for a _search.rhtml template.

For Ajax development with Rails, you're not tied to using Prototype or Scriptaculous. However, since Rails has helper methods that emit the JavaScript, it makes things much easier. If you'd like to use Dojo, you'd have to hand-code the JavaScript into your RHTML templates, or write helper methods for Dojo. Stuart would like to see a Rails plugin that allows you to switch the Ajax helpers from one library to the other.

The last thing Stuart showed was Prototype Windows. This looks similar to lightbox gone wild, except you get better styling around the modal window. If you haven't heard enough of what Stuart has to say, checkout blogs.relevancellc.com. One of the most interesting things lately is he's been posting reviews of the various Ajax books.

Posted in The Web at May 12 2006, 01:35:41 PM MDT 5 Comments

CSS Framework Design Contest: Final Results

20 people voted for the css design contest runoff. Of those, 3 people voted after the Tuesday midnight deadline. Here's the final winners of this contest:

  • 1st place: puzzlewithstyle by Mattias Fjellström
  • 2nd place: andreas01 by me (the question is: should I win or Andreas Viklund - the original designer?)
  • 3rd place: simplicity by Herryanto Siatono

The 3rd place winner was a close call: deliciouslyblue tied with simplicity, but 2 votes came in after the deadline. Congratulations to all the winners - and thanks for helping out with this contest.

Since I'm traveling in San Francisco this week and next, it'll probably take me a couple weeks to send out the prizes (iPods) to the winners.

Now for hard part: integrating the entries into AppFuse for 1.9.2. I hope to make all the winners AppFuse-compatible and ship them (or make them downloadable) as part of the release.

Posted in The Web at May 11 2006, 10:23:42 PM MDT 9 Comments

Ajax on Struts with Patrick Lightbody

I'm sitting in Patrick Lightbody's presentation on Leveraging AJAX in modern web frameworks. The point of this presentation is to give a preview of what's coming in Struts Action 2.0. There are a number of other good sessions I'd like to go to, particularly Intro to Dojo, but I figured it's better to attend this talk since AppFuse will be moving to SAF as part of 2.0. We're in a fairly small room, and there's about 20-30 people in attendance. With 400+ people at this conference, the other sessions are likely packed.

Ajax is more of a technique, rather than a technology. Commons Ajax techniques include:

  • Tabbed pane
  • Validation
  • Polling
  • Tree widget
  • Voting

For SAF, there are three core building blocks/tags: <saf:div/>, <saf:a/> (results evaluated as JavaScript) and <saf:submit/>. Divs are where things "happen" and links/submit buttons can trigger events. There are two frameworks used is SAF:

  • DWR: Remote invocation service for Java <-> JavaScript
  • Dojo: Language/server-agnostic JavaScript framework

There are two styles of Ajax: DOM manipulation (DWR) and partial pages (Dojo). SAF provides three Dojo widgets: BindDiv, BindAnchor and BindButton. The div tag supports the following attributes: href, updateFreq, delay, loadingText, errorText, showErrorTransportText, listenTopics and afterLoading. A simple example is polling - where the remote action returns HTML:

<saf:div href="mailbox.action?id=%{id}" updateFreq="2000"/>

Advanced usage of this tag includes adding a <script> block to the returned HTML. It will be executed when rendered, just like normal JavaScript is.

Tabbed pane is another component that's made up of two tags: <saf:tabbedPanel/> and <saf:panel/>. Rather than specifying content/tags within an <saf:panel>, to use the Ajax version, you simply add remote="true" and href="remoteUrl" to <saf:panel>. I asked about remote="true" being redundant and Patrick agreed it should be implied when an "href" attribute is defined.

SAF also includes the ability to have topic-based events. Dojo supports an event system, which was originally donated by the WebWork developers. Any element, such as a div, may listen to multiple topics. Any element, such as an href or tab header, may notify a topic.

The last thing that Patrick is demonstrating is Validation using DWR. To use it, you will need to use SAF's Ajax theme, as well as have DWR installed and configured. The remote calls to SAF's validation engine return serialized objects rather than HTML "partials". By default, it uses onBlur events to do the validation and all that's required on the client-side is validate="true" on your <saf:form>. Another cool Ajax feature that SAF has is an OGNL Console that gives you a command-line interface to evaluate OGNL expressions.

Patrick's lessons learned from implementing Ajax into WebWork/SAF:

  • Simple combinations of the basics can create powerful features, such as the tabbed pane or the tree widget.
  • JavaScript inside an HTML block (<saf:div>) or as returned from an action (<saf:a>) can provide valuable glue code.
  • The <saf:div/> and <saf:action/> tag have a close and important relationship.
  • Understand the important differences b/w Ajax styles (DOM-based vs. snippet-based). Both have their places.

Pitfalls:

  • Remember: there is no silver bullet
  • At the end of the day, your application is still a web site - don't forget that
  • Excessive polling can lead to extreme load and/or thread starvation
  • Common functionality, such as the back button and printing, can become difficult or confusing for the user (Dojo can help solve this problem)
  • Browser incompatibility can lead to two versions of the same application (see GMail)

The Struts Team hopes to release a preview release of Struts Action 2.0 this week or next, with a final release targeted for August.

Posted in Java at May 11 2006, 11:49:11 AM MDT Add a Comment

Yahoo's Grids CSS

Available Templates When I first saw Mike Stenhouse's CSS Framework, I was very impressed. It's hard to believe it's been a year since I first saw it, and only now am I integrating it into AppFuse. It figures that the week I'm implementing it, Yahoo comes up with something better: Grids CSS. Thanks to Jacob Hookom for e-mailing me the link.

The features of Grids CSS include:

  • Full A-grade browser support
  • More than 100 page layouts with a single CSS file at just 1.82KB
  • Flexible scaling with user font-size adjustments
  • Min-width enforcement, regardless of font or viewport size (except IE; helper JS under consideration)
  • Abundant DOM hooks for CSS and scripting flexibility
  • Source-order independence, allowing you to place your most important body content first in your HTML document
  • Self-clearing footer (no matter which column is longer, the footer stays at the bottom)
  • Centering within the viewport by default
  • Forward-compatibility as standard page structure evolves to claim more screen real estate
  • Accommodation for IAB Advertising Units

This is obviously a better solution than the CSS Framework, especially since it seems to be well-documented and allows source-order independence. However, it suffers from a similar problem: there's a lack of good-looking designer-styled templates that showcase how cool this library is. There is hope though, Andreas Viklund (a well-known open source template designer) is talking about a Modular CSS Template. The question is: will he re-use Yahoo's Grids CSS or invent his own?

[Yahoo's Grids CSS] is almost exactly what I was working on - but much smaller and probably better than I would have done it. The main difference is that I added a few extra layers to the cake: Make-up (layout-wide styling for typography, forms, headers, links and so on), Colorscheme (just what it sounds like) and Backdrops (background images). Designers can add each layer separately. If you have a site based on the template and you want to change the styling - add a new Make-up. It is a matter of cutting and pasting blocks of code into the CSS, even a beginner with no CSS design skill can do that. If you want to use different colorschemes for different pages - just add more colorschemes and call it from the colorscheme class of each page. One line of code to change, and the effect is very obvious?

It's cool to see there's lots of work going on in this space. While AppFuse 1.9.2 will include the CSS Framework, there's nothing stopping us from using a different solution for 2.0. I'm leaning towards moving to Yahoo's solution, but it's likely I'll be heavily influenced by Andreas' work in this space. Of course, since Yahoo's library is open source, it might make sense for Andreas to simply contribute to this project and improve what they've already done.

Posted in The Web at May 11 2006, 10:58:24 AM MDT 7 Comments

San Francisco - here I come!

The Ajax Experience I'm sitting in Denver's aiport, getting ready to jump on a plane and head to San Francisco for the Ajax Experience. Like most No Fluff shows, this one has 2-3 sessions I'd like to see during each time block. My primary goals are 1) to learn a lot 2) to blog about each session I attend, and 3) to get a good sense of what each Ajax framework does well. Hopefully there will be lots of demos I can link to.

On Friday night, a few AppFuse enthusiasts and I are getting together at the Thirsty Bear. If you'd like to join us, leave a comment and show up around 8:00.

Posted in Java at May 10 2006, 11:56:44 AM MDT 4 Comments

Better client-side validation with Prototype

I'd love to see something like Really easy field validation with Prototype integrated into Commons Validator and other web frameworks' validation engine. The only hard part would be looping through form elements and adding classes with the validation information. Other than that, it doesn't seem like it'd be too hard to implement. Hat tip to Ajaxian.com.

Posted in Java at May 09 2006, 02:59:29 PM MDT 7 Comments

CSS Framework Design Contest Winner and Runoff

I've tallied the votes as posted to the mailing list. Here's the results:

Congratulations to Mattias Fjellström for his winning Puzzle with style entry! The themes not listed here received 2 votes or less.

Based on these results, it looks like we need to have a runoff vote (for 2nd and 3rd place) between andreas01, deliciouslyblue, madeyourcss, fuseapp001 and simplicity. To place your vote, send an e-mail to [email protected] with "My favorite runoff theme is XXX" in the body. Voting will end at midnight (MDT, GMT-6) tomorrow night.

NOTE: "madeyourcss" had 6 votes sent to the mailing list, but 3 were from the same person. It might have been 4 that were sent from the same person, but since there's a runoff, I decided to add it to the mix.

Posted in The Web at May 08 2006, 02:54:03 PM MDT 3 Comments