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 "form". 326 entries found.

You can also try this same search on Google.

AppFuse 2.0 Status

Last week I managed to get AppFuse to compile with Maven 2, this week I got all the tests passing. This week, I struggled with Maven's WAR dependencies and how AppFuse will be used by end-users. It was frustrating, but I think I got most everything figured out. Unfortunately, there's still many issues to be sorted out.[Read More]

Posted in Java at Aug 26 2006, 02:41:26 PM MDT 7 Comments

Label placement in web forms

From Swapnonil Mukherjee:

Matteo Penzo has published an excellent article about the placement and alignment of labels in data entry forms. His research, though much more scientific and thorough, confirms what I had said earlier, about the importance of right aligning form labels.

Screenshot of User Profile In AppFuse 1.9.2, we added support for the CSS Framework and Wufoo-style forms. The new form layout appears to satisfy many of Matteo's suggestions. The only things we aren't doing are: 1) we're using bold labels instead of plain text and 2) we're using labels for drop-downs, instead of making the first element the label. I suppose the bold labels isn't much of an issue b/c we're not using heavy input borders. As for labels and <select> elements, I think the way we're doing things is good enough. If it works for Wufoo, it works for us!

Posted in The Web at Aug 22 2006, 12:43:01 PM MDT 7 Comments

Validation Framework Consolidation

Looks like Jason Carreira has stepped up to the plate to try and consolidate the validation frameworks we have in Java. I'm sure it was a joint effort among many, but Jason's name is the only one I see on the JSR. I applaud this effort - it's definitely needed.

I've used Commons Validator, the XWork Validation Framework as well as Hibernate's Validator. While Commons and XWork work, the ability to annotate a class and validate it anywhere/anyhow is pretty cool. I reviewed an article a couple months ago that hooked Hibernate Validator into Spring MVC and Prototype for client-side validation. There's a lot of good stuff in this space - let's hope this JSR creates something even better. More than anything, let's hope it doesn't brush off client-side validation like JSF did. ;-)

In an ideal world, the RIFE, Spring MVC, Stripes, Struts, Tapestry and Wicket developers will all participate and allow JSR-303's result to be used as their framework's validation engine. I think it's a given that this will be usable with JSF.

Posted in Java at Jul 11 2006, 02:05:37 PM MDT 18 Comments

RE: What Web Application framework should you use?

Tim O'Brien has an interesting post titled What Web Application framework should you use?. The first thing I noticed about this post is the permalink. It looks like he started with "Isn't Rails supposed to change...", which makes me wonder what the rest of the title was. In this post, he rags on Java Web Frameworks and the lack of a clear path for choosing one. He ends up predicting that many will stick with Struts 1.x (poor bastards) and those that aren't tied to Java should move to Rails. I don't have a problem with folks moving to Rails, but I would like to comment on the Java Web Framework space and Tim's comments.

He says:

Prediction: The confusion over what is happening over at Struts is going to discourage people from continuing to use it. The Struts team did the right thing in recognizing that Struts 1.x was a dead-end, but that project needs a single public message. Is it Struts Action or is it Struts Faces? Or is it two frameworks capitalizing on the Struts brand name?

I think what is going on in the Struts project is definitely two frameworks capitalizing on a brand name. That was a concious choice on the project's part when they chose to start creating sub-projects. The interesting thing about Struts Shale is it's largely a prototype for JSF 2.0. Furthermore, it was rejected by many Struts developers as becoming Struts 2.0. Why? Because JSF sucks. Especially when used with JSP - which is what most folks are doing.

JSF continues to be the most over-hyped under-used framework in Javaland. If you read the blogs of first-time users, you'll find many complaints and issues on how things work. Granted, most of these problems are with JSP and the implementation, but still. If I were in charge of JSF, I'd dump JSP altogether, bundle Facelets with it and allow more flexible page navigation (including controller-to-page). Don't get me wrong, I like the ideas behind JSF, I just don't like the implementation (or the fact I have to wait years for things to be fixed in the spec).

That being said, I've yet to meet an unhappy WebWork fan. If you find someone that still likes Struts, ask them if they've used WebWork. Chances are they'll say no. As far as Tapestry is concerned, the learning curve is too high. It's been rejected time and time again by my clients because of the learning curve. Are they going to fix this? Yep, they're going to re-write the whole damn thing - again! Every major point release of Tapestry throws backwards-compatibility out the window. Furthermore, I've heard once you get over the learning curve, it's a joy to work with. I've also met people at conferences that've used it over a year and say they're still struggling with its concepts.

Spring MVC - I wish I had bad things to say about it, but I don't. It (obviously) has the best Spring integration, but I've found WebWork much more pleasurable to work with. Sure, Spring has a ThrowawayController, but with a name like that, you can tell it's a second-class citizen.

Inspired by Tim's post, here's my prediction:

Struts Action 2 will be the best choice for developing Java-based web frameworks. Not only does it support JSF, but it's easy to learn, test and use. Furthermore, it seems to be the most often used framework in major software products and web sites.

How's that for a clear message? Struts Action 2 is the shiznit, now let's get back to developing applications.

Disclaimer: This is my opinion with a lot of stuff thrown in to get folks riled up. I've never put a JSF, Tapestry or Spring MVC application into production (except for AppFuse of course), so most of my opinions are likely without foundation. In wonder how many applications Mr. O'Brien has put into production with these frameworks?

Posted in Java at Jun 20 2006, 08:32:41 AM MDT 57 Comments

Happy Father's Day

Father's Day has been great so far. We started off this morning by opening gifts. The kids gave me some new framed pictures, as well as a whole bunch of huckleberries. I couldn't ask for better gifts. After that, we headed out to breakfast at my favorite joint, Pete's University Park Cafe. From there, we headed up to Tiny Town and rode around on the "Choo Choo Train". We stopped for ice cream on the way home and now I'm sipping a cold one while watching the US Open. Life is good. :-D

Abbie and Jack, June 2006

Thanks to my Dad for being such an inspiration - I hope I'm as smart as you someday Pappy. Can't wait to see you in July!

Related: Father's Day 2005, 2004 and 2003.

Posted in General at Jun 18 2006, 03:26:00 PM MDT 9 Comments

Is there a component like panelGrid that uses ul instead of table?

JSF 1.1 has a problem with JSP in that it can't bind components together when a page first loads. This is well documented in Improving JSF by Dumping JSP by Hans Bergsten.

The easy example of this problem is when you have <h:outputLabel> tags before <h:inputText> tags. The average JSF user might not notice the problem, but if you customize <h:outputLabel> to display "required field" indicators based on the "required" attribute of <h:inputText> - the issue slaps you in the face. The easy solution is to use <h:panelGrid> to layout your form data, and everything magically works. However, table-based forms are ugly and I'd much rather do pretty forms like this one.

In order to create pretty forms and get around the JSF sucks with JSP problem, I'm looking for a component similar to panelGrid - but it spits out <ul> and <li> instead of <table> and <tr>/<td>. Does anyone know of such a component? I asked this question on the MyFaces list this morning, but haven't had much luck.

I'm fully aware that Facelets (or Clay) will solve this problem. However, I'm merely trying to get AppFuse 1.9.2 released without making major changes. I suppose I could always go with ugly table-based forms, but I'd rather not.

Posted in Java at May 23 2006, 12:55:44 PM MDT 13 Comments

JavaOne 2006 Begins

After 3 hours of sleep, I'm up bright and early - attending the JavaOne Keynote. They're still shuffling people in, and have this awesome reggae-type band jamming. They're really good - I hope they're here later this week. The wireless sucks (as usual), so I'm using bluetooth to connect. Watch this post, I'll update it as the good announcements come.

We're starting off with a 10 minute overview of the Schedule Builder and how to use it. For those sessions that are full, apparently they'll schedule a 2nd showing. Most most sessions, there's already available online in PDF. After the show, most sessions should be available online in video form. Everyone should act like a Brazilian at this conference - meet people you don't know and learn as much as you can.

Jonathan Schwartz is on stage, dressed in a suite, talking about how they're offering a now offering a "Free Kit" on their website. Apparently, you can now get their Niagra servers for free. Sounds wierd, who knows if it's true. This JavaOne is the largest JavaOne ever, as apparent from this exhibition hall. "The Java community has never been more vibrant." The JCP has 1052 members. Of these, Jonathan says there aren't enough individuals on this committee. Everyone should go out and join. The community defines the future of Java.

Now there's a guy from Motorola on stage. He's the guy who originally introduced Java at this conference 11 years ago. The next few years will be just as crazy as the last 10 years for Java - only it will happen on a high-speed mobile network. In the mobile space, their are a lot of proprietary things going on. By encouraging and using Java, applications can be developed and deployed easily across many mobile devices. Motorola is selling 200 million phones this year. They've shipped 90 million in the last 6 months. Java needs to stay unified so write-once, run anywhere works on all devices. Motorola is publishing many open source projects for Java and Linux on http://opensource.motorola.com. To summarize, Motorola alone out-ships the PC industry.

Mark Shuttleworth from Canonical, Inc. is now on stage. Mark is deeply involved in the Ubuntu community. As of today, Java will be directly available to Ubuntu, Gentoo, Debian, etc. Apparently, this is because Sun has made some changes that allow it to be distributed with Linux. They're talking about Linux on Niagara - it sounds like there might be some announcements around this during the week. There's still no announcements about open-sourcing Java or re-licensing.

Mark Fluery has now been invited up on stage. He's got a red beret on. The Red Hat deal closes on May 31st. JBoss is joining the NetBeans community. Mark seems to think the next big thing in Java is Tools. Seems like a publicity stunt since they're talking about Netbeans. It will be interesting to see if JBoss becomes heavily involved in IDE development. Expect more innovation. You should expect more from the future, from the companies that provide Java, and from the community that uses it. Jonathan's first act of congress in his new post was to ask someone to return to Sun. Rich Green is the Executive VP of Software for Sun. He's been back at Sun for a week and a half, and he's been in meetings the entire time.

"Are you going to open source Java?", asks Jonathan.

"It's not a question of whether, it's a question of how." replies Rich.

So there you have it. They're going to open source Java, it's simply a matter of getting through all the politics and compatibility-issues to make it happen. Rich is now on stage by himself, encouraging the audience to get more involved in Java. Java EE 5 was recently approved. Now they've invited the Java EE Expert Group on stage. Everyone has a company sign to show. My name is on the slide, but it doesn't look like individuals were invited. Oh well, it's not like I contributed anything.

Jeff Jackson, Senior VP of Java Enterprise Platforms and Developer Products is now on stage. Java EE 5 is the big thing at the conference this year, and has all the right stuff: Ease of Development, simplified programming model with annotations, EJB 3.0 support for POJOs, new Java Persistence API, Web 2.0 Support, .NET Interoperability, Simplified SOA. NetBeans 5.5 supports Java EE today, so Jeff recommends you download it today.

Jeet Kaul is now on stage and he's going to do a demo of developing an application with Java EE 5 and NetBeans. He's using a nightly build from May 10th. I'm not sure if it's a nightly build of NetBeans or Glassfish that he's using. The demo he showed is pretty cheesy. He added an "author" column to a table, added a property to an Entity bean and then added an input field to the UI. This was followed with a web services demo and an Ajax demo. The Ajax demo was kinda cool - NetBeans allows you to drag and drop JSF components into a page. It drops in code rather than using a WYSIWYG view. I'm not sure if a WYSIWYG view is an option, as they didn't demo or mention anything.

Today Sun is donating their Java Message System (JMS) and NetBeans Enterprise Pack (UML, collaboration, etc.) to the open source community.

Craig McClanahan is on stage, He's got a slide with Duke holding a beer stein. The beer stein, and the Sierra Nevada that Craig pulled out are to represent the real reason we're here: The Beer. Craig is doing a demo with Java Studio Creator and creating a Pub Locator application that utilizes built-in GoogleMaps components. Craig deployed and showed a demo locating all the pubs near Moscone center. Then he turned "boss mode" on and clicked on a link to the Thirsty Bear. This took him to the new Java Ajax portal at developers.sun.com/ajax. Craig's demo was followed with a demo of the new Pet Store - with Ajax/Dojo enhancements.

Sun will be donating Java Studio Creator to open source (at netbeans.org) in the near future. In case you're not aware, Sun has recently released a number of other products on netbeans.org: NetBeans Profiler, NetBeans Mobility Pack, NetBeans Matisse.

Now there's a guy from Microsoft on stage talking about .NET and Java EE 5 interoperability. There's a "Tango" project that has a runtime that provides the interoperability between platforms. Now they're doing a demo with NetBeans 5.5 and its BPEL engine; all running on Open ESB. They demonstrating using WFC and Vista on the Windows side to connect to a web service on the GlassFish side. The Tango project has been renamed to Web Services Intererability Technology (WSIT) and is available on java.net at http://wsit.dev.java.net.

There's some new guys on stage now and they're talking about "Simplified SOA" with NetBeans Enterprise Pack using BPEL. While the BPEL tools in NetBeans look cool, they're definitely starting to lose the audience; people have started streaming out of the auditorium. More open source contributions: BPEL Engine into Open ESB and Sun Java System Portal Server.

Big Announcement: all of the technologies mentioned today will be under the umbrella of the OpenJava EE project.

Richard Blair (Swing Engineer from Sun) and Romain Guy have come on stage to demonstrate a Java SE Swing Web 2.0 Mashup. The demo uses Mustang and starts with showing a Swing client that connects to Flickr and allows you to browse photos. The slideshow feature is very cool and allows you to do 3d rendering and angling of images. It's one of the slickest-looking desktop apps I've ever seen. After showing the photo feature, they're showing how you can integrate this will a Google Map-looking service to show pictures on a map. All of the components in this demonstration are open source or simply customized Swing components. They ended the demo with showing a preview feature. The preview creates an applet that runs in a web browser (even when you're disconnected) and draws Roman's trip on a map, playing music and fading in pictures as the trip progresses. I was blown away at this point and would love to get my hands on this application. Hopefully it will be made available online, or maybe as a Flash movie?

There you have it folks. Sun is going to open source Java, just like I predicted a couple of weeks ago. It's not a matter of when, it's a matter of how. ;-)

Posted in JavaOne at May 16 2006, 09:40:33 AM MDT 5 Comments

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 and Open Laszlo with Max Carlson

Max is the co-founder and Lean Runtime Architect for Laszlo Systems. Max doesn't look at all like I pictured him (do they ever?!). He looks like a heavy-duty engineer, long curly hair, a little rough around the edges. I respect him more already. ;-)

Laszlo Systems Background: company founded in 2000. Laszlo Presentation Server (LPS) released in 2002. Embraced open source; LPS became OpenLaszlo. 2005: it's been widely adopted (130,000 downloads to date). This year, they're extending OpenLaszlo to support multiple runtimes, including DHTML. The company makes money of training and support, as well as developing custom applications (i.e. Laszlo Mail) and modules.

On 2/1/2006, Laszlo Systems joined a select group of tech leaders in establishing the Open Ajax community. Jointly committed to "making it easier for an open source community to form and popularize Ajax."

Demo's: Laszlo Mail, Pandora, Barclay's and Gliffy.

Developing with OpenLaszlo: XML-based, use your favorite XML editor. It's source-control friendly and has a library mechanism (for modularization). It's a familiar methodology for software engineers. It has standard OOP features: attributes and methods, class definitions with inheritance, familiar design patterns apply. There's an emphasis on declarative constructs. Finally, there's an open source Eclipse-based IDE4Laszlo. Originally developed by IBM, among the most popular downloads on alphaWorks. It now contains a WYSIWYG tool and is hosted at http://eclipse.org/laszlo.

LZX: Laszlo's XML Application Description Language: Flash independent tags and APIs (no ActionScript, movieClips, etc.; no need for Flash development). This allowed them to easily port to a different runtime. With OpenLaszlo, you can interface with your server via XML over HTTP, SOAP, XML-RPC and Java RPC. It has a runtime constraint system, hierarchical data binding with XPath. It has media, streaming support (although the Flash runtime seems to load images real slow - see the DHTML vs. Flash demo on http://openlaszlo.org).

Now Max is going through the Laszlo in Ten Minutes tutorial. If you haven't seen this, you should definitely check it out. It's a good quick introduction to OpenLaszlo. One of the unique features of OpenLaszlo is its components are written in LXZ. Compare this to XUL (components written in C) and Flex (components written in Flash) and it seems a lot more open.

In order to solve the nested-for-loops problem with JavaScript and DOM-manipulation, OpenLaszlo uses XPath and turns for loops into simple URL-like expressions. For example:

<text datapath="dset:/employee/firstName/text()"/>

Noticed on Max's Firefox toolbar: a del.iciou.us menu.

For the last 1/2 hour, Max has been talking about LZX, how to handle events, etc. In other words, since I've already worked with OpenLaszlo a bit, I haven't learned anything new.

Now Max is talking about OOP and how you can declare classes with certain attributes and then re-use them. It's kinda like Spring's "abstract beans" where you can declare a template bean and override attributes in child beans. In addition to allowing classes to be declared with no parent, you can create classes that extend an existing class. A common usage is declaring default values and then overriding visual elements (i.e. border size, colors, etc.).

OpenLaszlo 4.0 (with Ajax support) is targeted for a release by the end of the year.

Personally, I think OpenLaszlo is a very cool technology. However, it definitely needs a better IDE IMO. The last time I tried IDE4Laszlo on my Mac, it wasn't even close to useable. From a development perspective, using OpenLaszlo was difficult to work with because I felt like such a moron. With HTML and CSS, I know how to program UIs and it's difficult to give up that knowledge and rely on something else to provide the look and feel of my UI. In reality, I'm simply frustrated with my OpenLaszlo skills and would likely feel different if I was paid to develop a real-world application with it. After all, getting paid to work with a particular technology is almost always the best way to learn it.

Max is a great speaker and did a good job of introducing OpenLaszlo. Furthermore, this was one of the most interactive sessions I've seen at this conference. There's definitely a lot of folks interested in this technology.

Posted in The Web at May 12 2006, 11:50:24 AM MDT 1 Comment

Lessons learned building a 130+KLOC JavaScript application by Scott Dietzen, CTO of Zimbra

Scott Dietzen is the former CTO of BEA. Apparently he was one of the original founders of WebLogic, before it was bought by BEA. Scott's hope tonight is to share his experiences from developing Zimbra. Why does Zimbra use JavaScript and Ajax?

  • Richly interactive UI
  • Rich client/server communications
  • Zero-cost administration
  • Web security
  • Web look and feel (back button and bookmarks)
  • Multi-browser "standard"

All of the above features where things the Zimbra team expected. They also got lucky in a number of areas.

  • SAO/Mash-ups and Ajax authoring
  • RIA winner? Big sites voting with their feet: Google, Microsoft, Yahoo, Amazon, etc.
  • It really works

They started building Zimbra 2.5 years ago, long before Ajax was possible. Scott actually tried to talk his team out of using JavaScript when they first started architecting the application.

Zimbra's tools are good for Java programmers. If you're not familiar with OO concepts, it might be a bit difficult to understand. Now Scott is showing some demos, basically grids and trees - all built using the "Zimbra toolkit", whatever that is. Now he's moved on to demoing the Zimbra application itself. I used Zimbra as my primary e-mail client for a couple weeks and it's by far the best web application I've ever used. Not only does it look awesome, but everything works just as it would in a desktop application. The unfortunate thing about Zimbra is it has two licenses: an open source one and a pay-for version that has all the features you really want.

Zimbra = "Pure" Ajax. All UI behavior specified in JavaScript. The *entire* UI is written in JavaScript, no HTML. It's more like a typical GUI application from a programming perspective (think JavaScript SWT). Result is "husky" client 3-tier architecture. All UI on client, server-side Java code for UI operations. This is very different from HTML "design center" where you start with an HTML page and augmenting with Ajax. The Zimbra toolkit actually doesn't fit very well into most applications, where folks enhance HTML pages. It's more designed for programmers who want to write their entire application in JavaScript.

Ajax is finally giving us a clear partition between client logic and server logic. The dividing line is up to the developer, that's the challenge for web developers today. It's basically a user-defined SOA Endpoint. Before Ajax, in the Java world, JSPs and Servlets were considered the client-side, even though they were really more server-oriented.

Ajax applications are cheaper on the server/network than Web 1.0/HTML apps. Modulo the initial download (gzip is essential). Ajax is much more expensive on the client CPU. Tend to be finder grained in their client/server interactions. They tend to be more stateful. Rule #1: Pick your service bindings well! For modularity and re-use/mashups.

"There's a special place in heaven for whoever had the patience to get all of that JavaScript right." - Paul Ambrose, WebLogic Founder on Zimbra

Ajax Challenges: Browsers and Toolkits. Browsers render the same HTML differently, they have different event models, different levels of DOM supported, they have different APIs that do the same thing, as well as many issues. As far as toolkits for Ajax, there's too many rather than too few. Consolidation would definitely be a good thing.

Zimbra's Ajax Tookit (AjaxTK), Apache Kabuki* is modeled after SWT. It's a JavaScript OO class library and open source (Mozilla or Apache licensed).

Another big challenge is lack of integrated tooling. There's lot of technologies to deal with concurrently: HTML, CSS, JavaScript, etc. The initial stab at a solution is the Open Ajax Initiative. This is largely a set of technologies from Eclipse, Mozilla and Apache. There's 30-odd companies involved with the initiative, including: IBM, Zimbra, Eclipse, Firefox, Apache, Google, Yahoo, Oracle and Red Hat (or at least that's the logos Scott has on his slides).

The proprietary Ajax Landscape consists of MS Visual Studio (Tooling) and MS Atlas (Toolkit). On the open source side, there's Eclipse+Mozilla for tooling and all kinds of frameworks for toolkits (i.e. Zimbra/Kabuki, Dojo, Scriptaculous). Scott's opinion is there's really no room for any proprietary vendors to provide solutions outside of Microsoft.

Now Scott is doing a demo of mash-ups in Zimbra. He's showing how you can mouse-over many things in an e-mail message to get the information you're looking for w/o switching to a new page/context. Mash-ups he showed include: real-time flight information, displaying schedule for a particular day, dragging a message to an SMS sender, viewing a map by mousing over an address. The latest thing they're working on is dragging an appointment from a calendar to a "travel agent" that books your flight.

Zimbra also includes a WYSIWYG authoring environment for documents. It allows you to do HTML editing (in design view) as well as embedding spreadsheets within pages.

Zimlets: extensible mash-ups for e-mail, calendaring, IM, etc. They're a merge of "pull" and "push". There's zero-client install and they're secure because they're managed by the server administrator. To create a Zimlet, you develop a declarative XML template (Regex, ActionURL, XSLT, CSS, Menu). JavaScript can be used to override Zimbra client-based classes. JSPs can be used on the server-side for customization. Ajax Linking and Embedding (ALE) is Ajax components that are embeddable in editable HTML (simple docs, spreadsheets, etc.). Views are read-only HTML and WYSIWYG Ajax authoring (Ajax cod is the "authoring" application).

Practical Tips for Ajax:

  • Use an Ajax toolkit
  • CSS is your friend
  • Use JSON (as well as XML)
  • Use asynchronous network programming
  • MVC paradigm worked for us
  • Tooling better, but rough edges remain
  • _all.js -> jsmin (saves ~ 1/4X)
  • _all.js, _all.css -> gzip (saves ~ 3-4X)
  • Mercury's QuickTest-Pro (QTP) [IE + FF*]
  • Pick your fights - not all applications need to be Ajax enabled
  • No such thing as secure client-side business logic in Ajax
  • Dedicate some top UI OO talent (or wait for tech to catch up)

Ajax Sweet Spots:

  • Richly interactive UI desirable (HTML simplicity is ideal for many applications - for example, you'd rather use Amazon's one-click than drag a book to a shopping cart)
  • Combine with web look and feel and deployment
  • No client-side data/resources (but is changing, stay tuned)
  • Perfect for on-demand services

Recipe for Ajax Success: Ajax is not a business model, compelling and appropriate innovation is essential.

Next Ajax Steps: In open source land, try the OSS toolkits, Eclipse ATF and participate in Ajax communities (Apache/Zimbra, Eclipse, Mozilla, Dojo, Scriptaculous). Scott moved to fast for me to catch his recommendations for Microsoft developers. He did have positive things to say about Microsoft though.

Hardest Ajax problem of all? Recruiting. According to Scott, it's incredibly hard to recruit people that know Ajax.

Update: Additional coverage of this talk is available at Ajaxian.com.

Posted in The Web at May 11 2006, 09:54:26 PM MDT 7 Comments