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.

[TSSJS] Friday Morning: RIFE and Seam

This is my 2nd day in Vegas and so far this town is treating me fairly well. I haven't lost all of my money, but the $25/hand blackjack tables haven't been kind. Yesterday, I woke up with a glass full of Berocca next to my bed - which means I passed out before drinking it. I needed it too, Matt Filios won a poker tourney and a bunch of us enjoyed "bottle table" (with Kettle One vodka) to celebrate. Spendy and good, but painful the next day.

Last night, I heard it was Crazy Bob's bachelor party, so I went to bed early to avoid the debauchery. Julie and a good friend of mine are flying in tonight, so there will be plenty of that this evening. So after a good night's sleep, I'm up early and attending the conference. The first hour has a lot of good sessions: Introduction to Seam (Gavin), Dive into RIFE (Geert), OSWorkflow (Hani) and Transforming Enterprise Java into a Commodity (Geir).

I'm sitting in Geert Bevin's session titled "Dive into RIFE" and it's a pretty small audience - maybe 20 people. Geert is the CTO of Uwyn, a small custom application development company. He's the founder of RIFE and creator of many RIFE projects: RIFE/Crud, RIFE/Jumpstart, RIFE/Continuations, Bamboo (forum), Bla-bla List (RIA todo list), Drone (Information bot) and Elephant (blog).

What is RIFE? It's a full-stack component framework to quickly and consistently develop and maintain Java web applications.

  • Integrated layers allow you to quickly get results with a minimal amount of code
  • Best practices are enforced in a pleasant way, providing many additional features and a consistent approach throughout all applications
  • Components can easily be resused in many contexts
  • Creating maintainable applications is our first goal
  • A lot of attention goes to code-level developer comfort
  • Frustration reduction by instant changes and reloads
  • Creative solutions for difficult problems
  • Embraces established standards (XHTML, HTTP, SQL, ...)
  • Geared to developing web applications and doesn't abstract away too much
  • Everything besides the web engine is designed to be independently usable
  • Attention to the whole life-cycle of your application

Geer is now talking about all the different pieces of RIFE - how it has a JDBC abstraction like Spring JDBC, web services support (even publishing of RSS Feeds) and a content management framework. Now we're going to look at RIFE/Jumpstart.

What is RIFE/Jumpstart? It's a source archive that you unzip and run. It makes it easy to start with new RIFE applications and contains everything you need (including Jetty). It has immediate support for more common development environments (X-develop, Netbeans, Eclipse, IDEA and Ant). Geert just showed us a video of getting started with Jumpstart and how you can easily use X-develop to build and deploy the app to Jetty. The Jumpstart application currently uses JUnit, but since the RIFE teams is starting to use TestNG more and more, it's likely they'll change in the near future. RIFE Jumpstart looks similar to AppFuse, except they have the save+reload problem solved - using JVM HotSwapping.

Now I've moved to the Introduction to Seam session. Gavin King is the presenter and the room is packed. It's a big room, so that's saying a lot. Gavin is talking about JSF, how backing beans work and what's in the faces-config.xml. How does Seam compare to J2EE? Much simpler code. There's fewer artifacts (no DTOs). Less noise (EJB boilerplate, Struts boilerplate). More transparent (no direct calls to HttpSession or HttpRequest). It's also much more powerful for complex problems.

JSF is amazingly flexible and extensive. EJB interceptors support a kind of "AOP lite" and EJB3 is a powerful ORM engine. Everything (except for the JSP pages) is unit testable can be tested with JUnit or TestNG. For testing the view layer, Gavin recommends using Selenium.

A backing bean is often "pure glue" and is just noise. Furthermore, it accounts for more LOC than any other component. It doesn't really decouple layers, in fact the couple is more coupled than it otherwise would be. Gavin calls this "wedding cake architecture." These applications look good in the window, but don't taste good when you eat them. I get his point, but have to disagree on the taste of wedding cake. It's always been good at the wedding's I've attended. ;-)

By default, web applications in general do not work in a multi-window application. To make it work, it generally requires a major architecture change. A couple of other areas for improvement in traditional web applications: application leaks memory (not cleaning up session objects) and "flow" is weakly defined. Navigation rules are totally ad hoc and difficult to visualize. How can this code be aware of the long-running business process?

JBoss Seam - what does it do? It unifies the EJB3 and JSF component models. It simplifies Java EE 5, filling a gap. In addition, it integrates jBPM and makes it more developer-friendly. Deprecate so-called stateless architecture. Decouple the technology from the execution environment. Run EJB3 apps in Tomcat or in TestNG or use Seam with JavaBeans and Hibernate. Gavin is using Tomcat for the first time and thinks it's hot-deploy architecture is totally broken. Of course, he usually uses JBoss and never has a problem with hot-deploy. It's interesting to hear this from Gavin, especially since I've heard from others that Hibernate breaks the reloading - and it's not the server's fault.

I'm going to head to another session now, but I did look ahead at some of Gavin's slides. Interestingly enough, the jPBM pageflow definition's XML looks quite similar to Spring Web Flow. Speaking of flows, I heard an interesting comments from someone yesterday after they attended Geert's continuations talk. Apparently, after seeing his talk, they think that RIFE's continuations offer a much more elegant solution to pageflow than these "XML programming" mechanisms.

I tried to go to Hani's OSWorkflow talk, but he was doing Q&A when I walked in. Apparently, he finished 25 minutes early. Then I walked into Geir's talk only to find Dan Deiphouse finishing up an XFire talk. Oh well, there's nothing wrong with having a few minutes to mingle between talks.

Posted in Java at Mar 24 2006, 11:56:30 AM MST 7 Comments

TSSJS BOF: Web Framework Sweet Spots

I'm leading a BOF at this year's TSS Java Symposium titled Web Framework Sweet Spots.

The objective of this BOF is to discuss the various open source web frameworks and what each does well. Matt kicks off the discussion by highlighting the good features of various frameworks, (results of pre-conference discussions with various framework authors to get their opinions on what problems their framework solves best) as well as debunk some myths based on audience members real-world experiences.

Yesterday, I sent an e-mail the authors of the most popular web frameworks in JavaLand. In my opinion, these are (in alphabetical order): Cocoon, JSF, RIFE, Seam, Spring MVC, Spring Web Flow, Struts, Trails, Tapestry, WebWork and Wicket. If your framework isn't on this list, I'm sorry. If you can prove to me that yours is more popular than one of the ones listed here, I'll send you the questionnaire and add you to the list. I've received a few responses, and I doubt all authors will respond, so there might be some room.

If you're going to be at Caesar's Palace for TSSJS 2006, I invite you to stop by on Friday night at 6:30. I've asked the TechTarget folks several times about getting beer served at this BOF, but they keep ignoring the question. I think it's time to contact Caesar's - since it is legal to have a beer pretty much anywhere in Vegas.

Posted in Java at Mar 08 2006, 02:23:13 PM MST 19 Comments

CSS Framework Design Contest

Over the past 2 weeks, I've managed to raise $900 for the CSS Framework Design Contest. Thanks to friends, AppFuse users and SourceBeat their donations. You guys rock!

With this cash, I hope to give away 3 prizes: an iPod (60GB), an iPod (30GB) and a 2GB Nano. Of course, if the winners decide they'd rather donate the money to charity, that's cool too. Any additional donations I receive I'm going to send to the Elena Steinberg Memorial Fund.

Here's the rules of the contest: Create a theme (mostly CSS, images allowed) that makes the CSS Framework look good (download source files). This framework is simply a structured bit of XHTML for page layout, and a number of CSS files for positioning. What's missing is a number of good-looking themes to make this framework look even better. I have aspirations of creating something like CSS Zen Garden - but with more of a web-application flavor.

I'll use the same submission guidelines as the CSS Zen Garder, but add that your themes should be Apache licensed. In my mind, this simply means that anyone can use your theme - they simply have to retain your contact information in a comment w/in the stylesheet itself. I'd like to distribute (or at least make available) the top themes to AppFuse users - so they aren't stuck with a single theme. In addition, it probably wouldn't be too hard to make these into Roller themes.

The CSS themes from this contest should be usable in corporate intranets, as well as customer facing applications. Sure, wacky designs are cool, but sharp and clean are better. Extra points will likely be given for themes that pretty up how forms are laid out and displayed. Ajaxian.com links to some good examples, particularly Wufoo.

I've created a CSS Design Contest project in AppFuse's JIRA - so please submit your entries there. The contest ends on March 31st, 2006 at midnight MST. After that, the winners will be decided using some sort of voting mechanism. I hope to create an application to showcase all the entries in the next week or two.

For inspiration, you might checkout Open Web Design and Open Source Web Design.

Good luck folks - may the best design win!

Posted in The Web at Mar 03 2006, 06:12:47 PM MST 28 Comments

Quote of the Day

Alex Russell: "It's a cock tease in the form of a laptop."

Posted in Mac OS X at Feb 22 2006, 12:22:28 PM MST Add a Comment

Fundraiser for CSS Framework Design Contest

A week ago, I received a $250 donation for "AppFuse Development". This is a significant amount of cash, and unfortunately the committers can't do a "beer at the local pub". We've decided that a good thing to do with the money is to use it to buy a prize for a CSS Framework Design Contest. The AppFuse Logo Contest went well, but I also gave away an iPod to the winner.

This contest will be a bit different. First of all, the CSS Framework is not AppFuse-specific at all. It's just a structured bit of XHTML for page layout, and a number of CSS files for positioning. What's missing is a number of good-looking templates to make this framework look even better. I have aspirations of creating something like CSS Zen Garden - but with more of a web-application flavor. Hopefully we can use the same submission guidelines as well as offer the contest's themes for anyone to use. The CSS themes from this contest should be usable in corporate intranets, as well as customer facing applications. Sure, wacky designs are cool, but sharp and clean are better.

I hope to start this contest as soon as I've raised some funds for good prizes. Of course, donating good prizes is most welcome too. In order to provide some motivation, I'm going to do something that will hopefully inspire you to donate. It's butt-ass cold in Denver this week, and it's not warming up anytime soon. Here's the current forecast from the local news channel:

Forecast: 2/19/06 - 2/24/06

So to try and raise money, I'm going to ride my bike to work every day this week. Will this inspire folks to donate? I don't know, but it's worth a try. I'll try to be in the office by 9, and won't be home before 5. This should ensure that it's good and cold out. Furthermore, I'll blog about my ride everyday, and hopefully snap some pictures as well. It's supposed to snow tonight, so this should be good.

320

Remember, anything will help - and all donations will go to a good cause. I plan on starting the actual design contest next week sometime. Now it's time to donate using the button below - and watch me freeze my ass off this week! ;-)

Posted in The Web at Feb 19 2006, 09:34:39 PM MST 9 Comments

Updated Web Tier Specs for Java EE 5

Ed Burns (JSP Spec Lead) points out there's New Drafts of Java EE Web Tier: JSF 1.2, JSP 2.1, Servlet 2.5

I'm pleased to announce another revision of the Java EE Web Tier. In Jan Luehe's blog you can find out what's new in JSP 2.1 Proposed Final Draft 2 (PFD2). The Change Log for Servlet 2.5 will give you the scoop on the Servlet spec. This blog entry will show what's new in the JSF spec.

In JSF, the most visible new feature since the last draft of the spec is the addition of the invokeOnComponent() method on UIComponent. See below for more details.

This revision of the Java Web Tier is fully implemented in glassfish build 37, Sun's open source Java EE 5 Application Server, and the basis for the upcoming Java EE SDK.

I changed the link to Jan Luehe's blog because Ed's link seems to be incorrect. My guess is Java EE will be finalized and released before JavaOne. This is how Sun usually does things: work like mad until JavaOne, then take a week or two off to celebrate the release. Other rumors I've heard are that JBoss and Geronimo hope to release Java EE 5 compliant releases by or at JavaOne.

2006 is shaping up to be quite a year for the popular Java web frameworks. Tapestry 4.0, WebWork 2.2, JSF 1.2 and Spring MVC 2.0 (with form tag libraries and smart defaults). The question is, how long will it take for MyFaces to implement JSF 1.2? And when will we see a large-scale site deployed with JSF?

Why isn't Struts or your favorite framework in this list? Struts is being replaced by WebWork and the rest simply don't have the market share. No one has heard of RIFE or Wicket. However, that didn't stop me from encouraging SourceBeat to publish a Wicket book. Having good (published) documentation about a project is the first step to corporate adoption IMO.

Posted in Java at Feb 17 2006, 11:06:34 AM MST Add a Comment

Dependency Injection with SiteMesh

Let me start off by saying I think that both SiteMesh and Tiles are great frameworks. I was a long time user and fan of Tiles, and I think it's appropriate for certain situations. However, I've been a heavy user of SiteMesh since it passed the 10 minute test. While most heavy users of SiteMesh (the Atlassian guys come to mind) say that it can do everything that Tiles can do, these features are largely undocumented. This is my attempt to document a cool feature.

In a site I recently helped develop, we needed a couple of features:

  • A tabbed menu that highlighted the current tab based on which page you were on.
  • A bunch of "panels" on the right sidebar that changed according to the page.

To make this work, we used the meta tag functionality that SiteMesh provides.

Funny side/related note, I just googled for this tag and found this howto, which is similar to this one.

In our pages, we added the meta tags to set the active menu, as well as which panels to show in the sidebar:

<head>
    <title><fmt:message key="authorList.title"/></title>
    <meta name="menu" content="Authors"/>
    <meta name="panels" content="administration,blogs,events"/>
</head>

Then, in our decorator, we interpret these separately. First, we used Struts Menu (with Velocity) for the navigation system:

<c:set var="currentMenu" scope="request">
    <decorator:getProperty property="meta.menu"/>
</c:set>
<c:import url="/WEB-INF/pages/menu.jsp">
    <c:param name="template" value="/template/menu/tabs.html"/>
</c:import>

The menu.jsp page takes "template" as a parameter so we display the same menu links using a different Velocity template (for example, links at the bottom of the page).

<menu:useMenuDisplayer name="Velocity" config="${param.template}" permissions="rolesAdapter">

Then our tabs.html Velocity template uses the "currentMenu" attribute to determine which menu to highlight.

## displayMenu is defined in WEB-INF/classes/globalMacros.vm
#macro( menuItem $menu $level )
  #set ($title = $displayer.getMessage($menu.title))
  #if ($menu.url)
    #if ($menu.name == $currentMenu)
      <span class="current">
    #end
      <a href="$!menu.url" title="$title"><span>$title</span></a>
    #if ($menu.name == $request.getAttribute('currentMenu'))
      </span>
    #end
  #end
#end

#if ($displayer.isAllowed($menu))
    #displayMenu($menu 0)
#end

As far as the panel injection goes, that's processed using the following logic in our decorator:

<c:set var="panels"><decorator:getProperty property="meta.panels"/></c:set>
<!-- No panels set, use default set of panels -->
<c:if test="${empty panels}"><c:set var="panels" value="different,partners"/></c:if>
<c:forEach var="panel" items="${panels}">
    <c:import url="/WEB-INF/pages/panels/${panel}.jsp"/>
</c:forEach>    

Since this site used WebWork, the <ww:action> tag made it easy to give each panel independence. That is, each panel could load on its own, supply its own data, and not worry about the data being prepared beforehand. Here's an example:

<%@ include file="/common/taglibs.jsp"%>

<h2>Author Blogs</h2>

<ww:action name="'authors'" id="authors" namespace="default"/>

<div class="item">
    <ww:iterator value="#authors.authors" status="index">
        <a href="<ww:property value="blog.feedUrl"/>">
            <img src="${ctxPath}/images/icons/xml.gif" alt="XML Feed" 
                style="margin-right: 5px; vertical-align: middle"/></a>
        <a href="<ww:property value="blog.url"/>"><ww:property value="name"/></a>
        <br />
    </ww:iterator>
</div>

Of course, now that you can use Tiles with WebWork, Struts, Spring MVC and JSF - you could use Tiles for the injection and SiteMesh for the decoration.

Now if we could just get someone to write a JSF Decorator for SiteMesh, like Erik Hatcher did for Tapestry.

Posted in Java at Feb 16 2006, 09:57:23 AM MST 6 Comments

Large sites powered by Java web frameworks and Tiles + WebWork

Yesterday, I delivered a Comparing Web Frameworks seminar that included Struts, Spring MVC, WebWork, JSF and Tapestry. This was for a client that's in the process of re-working an extremely high traffic site (50+ servers currently) from Servlets + JSPs to a web framework. They love the idea of Tiles (and know how to use it) as well as plan on integrating many Ajax features.

We quickly eliminated Struts because of ActionForms since they're planning on moving to persisted POJOs. Spring MVC and JSF had a notch up because they work with Tiles. However, JSF has reportedly had scalability issues. Furthermore, it's the most-complained about framework out there. One attendee noted how she was impressed with the low number of complaints about WebWork.

WebWork doesn't integrate with Tiles (but probably will soon) and they were concerned about SiteMesh performance with large pages (1MB + of text). While I believe SiteMesh can do almost everything that Tiles can do, I also agree that Tiles is a good technology. Furthermore, the "advanced features" of SiteMesh to be largely undocumented, which can be a barrier for adopting it as a "development standard".

Spring MVC was dinged because it doesn't have built-in Ajax support like WebWork and Tapestry (via Tacos). However, it's support for Tiles might just make it the one they choose - especially since they plan on using Spring in the middle-tier/backend. While they loved the idea of Tapestry, they didn't think they could afford the learning curve and I don't know enough about the @Border component to verify if it has all of Tile's functionality.

One interesting thing that came up was the list of high-volume sites using these various web frameworks. Tapestry seems to come out on top when you look at the list of well-known sites. However, I'm sure there are plenty I don't know about. If you know of high-volume sites using any of these five frameworks, please let me know. I'm looking for major sites with millions of hits per day. Here's my current list (extra points for fancy templating with SiteMesh/Tiles + Ajax widgets):

  • Struts: None that I know of off the top of my head, but I'm sure there are plenty.
  • Spring MVC: None that I know of.
  • WebWork: JavaBlogs (don't know if this exactly qualifies as high-volume, there aren't that many Java developers). WebWork also has a few products based on it (i.e. Jive, JIRA, Confluence), but these companies also employ WebWork committers.
  • JSF: None that I know of.
  • Tapestry: NHL.com, TheServerSide.com (similar comments to JavaBlogs) and Zillow.com.

Thanks!

Related: How To use Tiles like SiteMesh and SourceLab's Web application technologies comparison (with performance numbers!).

Update: FWIW, I figured out How to use Tiles with WebWork and wrote a short howto for doing dependency injection with SiteMesh.

Posted in Java at Feb 15 2006, 11:55:57 AM MST 30 Comments

Does JPOX suck?

There's an ongoing effort in Roller to migrate from Hibernate to JDO. Mostly, this is due to Apache's silly rule about no L/GPL dependencies - even if they're downloaded separately. I think this is a valiant effort, especially if JDO performs as well as Hibernate.

However, it was interesting to see the following message on the mailing list this morning:

i have experience using jdo, and jpox in particular, with a commercial product. first, you probably already know this, but jdo is dead (from a spec perspective anyway). it will be phased out in favor of ejb3 persistence. maybe that transition will be graceful, maybe not. i see jpox has ejb3 on their roadmap, but not sure what that means.

second, jpox has really, very atrocious performance issues. the jpox folks admit that performance is a low priority, as they are an ri. if someone wants the details on this, i can dig them up.

Interestingly enough, this message is from a Sun employee. It's interesting to hear someone from Sun say that "jdo is dead". What are you thoughts? Should Roller change their persistence backend just to satisfy Apache?

Of course, now you'll tell me your favorite Apache-licensed persistence framework and why it's worked so well for you. The real question is - are you willing to re-write Roller's backend using it? ;-)

Posted in Java at Jan 25 2006, 10:57:56 AM MST 31 Comments

The future of the DisplayTag Library

From the displaytag-devel mailing list:

I am sorry if I am asking a stupid question but is there any activity going on in the project? There are no new releases for almost a year... Neither are there any news on the project page. In our project we have modified the 1.0 version a bit and would like to share these changes with the community.

Fabrizio's response:

See http://displaytag.sourceforge.net now ;)

the website was frozen to the last 1.0 release, also due an extensive refactoring to the build/documentation system (migration to maven 2, splitting of optional modules and examples, ...) but activity on the project never stopped.

1.1 is now near, and I switched the default homepage to the 1.1 documentation. Warning: it's not released yet, but nightly builds are up.

The biggest feature of 1.1 has to be the ability to do external sorting and paging.

If you're looking for Ajax support in the displaytag, look no further than AjaxTags. I haven't been able to get ajax:displayTag working in my projects because I'm using a newer version of Prototype. However, it looks like the next version of AjaxTags supports the latest version of Prototype.

In addition to AjaxTags, you can also use AjaxAnywhere. Here's the code you'll need to do that (after adding AjaxAnywhere to your project):

<aa:zone name="userTable">

<display:table name="users" class="list" requestURI="" id="userList" export="true" 
    excludedParams="*" pagesize="5" sort="list">
    <display:column property="id" sort="true" href="editUser.html"
        paramId="id" paramProperty="id" titleKey="user.id"/>
    <display:column property="firstName" sort="true" titleKey="user.firstName"/>
    <display:column property="lastName" sort="true" titleKey="user.lastName"/>
    <display:column titleKey="user.birthday" sort="true" sortProperty="birthday">
        <fmt:formatDate value="${userList.birthday}" pattern="${datePattern}"/>
    </display:column>
</display:table>

</aa:zone>

<script type="text/javascript">
    ajaxAnywhere.getZonesToReaload = function() { return "userTable" }
    ajaxAnywhere.onAfterResponseProcessing = function() { replaceLinks() }
    function replaceLinks() {
        // replace all the links in <thead> with onclick's that call AjaxAnywhere
        var sortLinks = $('userList').getElementsByTagName('thead')[0]
                                     .getElementsByTagName('a');
        ajaxifyLinks(sortLinks);
        if (document.getElementsByClassName('pagelinks').length > 0) {
            var pagelinks = document.getElementsByClassName('pagelinks')[0]
                                    .getElementsByTagName('a');
            ajaxifyLinks(pagelinks);
        }
    }
    function ajaxifyLinks(links) {
        for (i=0; i < links.length; i++) {
            links[i].onclick = function() {
                ajaxAnywhere.getAJAX(this.href); 
                return false;
            }
        }
    }
    replaceLinks();
</script>

Libraries used in above code: AjaxAnywhere 1.0.2, DisplayTag 1.0 and Prototype 1.4.0_pre4. You can also see a demo online or download the code.

Posted in Java at Dec 29 2005, 10:46:56 AM MST 26 Comments