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 "matt". 663 entries found.

You can also try this same search on Google.

NYC Seminar: Flex and WebWork

Christophe talked about Flex, it's architecture and built the data grid for the Flex pet store in a matter of minutes. After seeing this presentation, I definitely think Flex is wicked cool. It's too bad that it's price tag is $6K/CPU. However, Vic is probably right - this stuff should be the next generation of webapps. I'd order the developer CD but it sounds like something I'd play around with and never use. It looks so easy to use that I'm willing to bet I can wait until a client demands it - then learn it in a matter of days - or even hours. I did end up asking Christophe about unit testing these Flash UIs. They're working on it, but nothing exists yet.

Now Jason is up - the last session of the day.

What is WebWork 2.0?

  • The 2nd generation of WebWork
  • A web MVC Framework
  • a wrapper on top of a generic Command Pattern implementation (XWork)
  • A small but powerful tag library

XWork is where Jason spends most of his time. XWork is a generic command pattern implementation. Actions are command objects in XWork. XWork adds advanced features.

  • Interceptors: setting parameters, workflow, etc.
  • Results: includes one for chaing to another Action
  • Simple IoC container
  • Powerful expressional language (OGNL)
  • Flexible type conversion
  • Metadata driven validation framework

What does WebWork add?

  • Adapter for Http request/response
  • Integration of Session / Application Scopes
  • ServletDispatcher translates HTTP Requests into Action execution
  • Request parameters passed to Action Results
  • Supported view technologies: Velocity, Freemarker, XSLT Jasper Reports, JSP

Action is a simple interface with an execute method. ActionSupport is a useful base class.

I gotta say - one of my favorite things about WebWork is the fact that all its UI tags are built using Velocity. This means that you (the developer) have full control over what HTML is generated from the JSP tags.

Interceptors have been nicknamed "Domain AOP." Interceptors allow custom code into the call stack and much of the WebWork "magic" happens with Interceptors. WebWork has a number of built-in interceptors:

Setting Parameters

  • ParameterInterceptor
  • StaticParameterInterceptor
  • ChainingInterceptor
  • ConversionErrorInterceptor

Defining Workflow

  • DefaultWorkflowInterceptor
  • PrepareInterceptor
  • ServletConfigInterceptor

Preventing duplicate posts

  • 2 types of token interceptors

Interceptors can be grouped into named Interceptor Stacks (i.e. defaultStack, validationWorkflowStack).

2 types of actions possible: Model-Driven vs. Field Driven (merging of Action and ActionForm). ModelDriven Interface - public Object getModel(). Porperties of the model will be available as simple properties - "user.name" becomes "name". To use, you have to add ModelInterceptor to your WW config file.

OGNL (Object Graph Navigation Language). An expression and binding language for getting and setting properties of Java objects. Normally the same expression is used for getters and setters.

XWork Validation Framework

  • XML based. Validation file in the same package as the class. Defines one field validator and the error messages to add if it fails.
  • Bundled validators - supports required, range, email, url and OGNL Expressions (very powerful).
  • JavaScript support recently added for simple validators - nothing for expressions though (tough to do).

Doh! Jason's demo didn't work. I did a lot of demos in my preso so I couldn't help but say "shoulda used a Mac!" These PowerBooks might be a bit slow for development, but they're definitely nice for this traveling salesman thing.

This is where you get your money's worth: All the speakers and attendees comparing frameworks, talking about their problems and trying to figure out a better way.

Posted in Java at Apr 03 2004, 04:13:54 PM MST 8 Comments

Off to NYC

In the midst of getting all my ducks in a row for New York City - I thought I'd share the latest schedule. It doesn't seem to be posted anywhere else, so why not. First of all, it's at the New Yorker Hotel and here's the latest line-up:

  • 9:15 - Rod Johnson
  • 10:15 - Clinton Begin
  • 11:15 - Ted Husted
  • Lunch
  • 1:30 - Matt Raible
  • 2:30 - Vic Cekvenich
  • 3:30 - Christophe Coenraets
  • 4:30 - Jason Carreira

Hope to see you there!

Posted in Java at Apr 02 2004, 03:33:21 AM MST 7 Comments

Macromedia Flex 1.0 Released

Macromedia has released Flex 1.0. Flex is basically a server plugin that allows you to write XML to render flash. Here's the marketing lingo from their product page:

Flex is a presentation server installed on top of a J2EE application server or servlet container, a rich library of user interface components, an XML-based markup language used to declaratively lay out these components, and an object-oriented programming language which handles user interactions with the application. The result is a Rich Internet Application rendered using Flash Player and developed using industry standards and a development paradigm familiar to developers.

The major problem with Flex is its price.

Flex presentation server pricing starts at $12,000 for two CPUs and includes annual maintenance.

Macromedia's take on this seems to be "its an evolutionary step in web application design and development" - so $12K is a small drop in the bucket. Sun claims the same for JSF, but you don't see a hefty price tag on that sucker. What Macromedia doesn't seem to realize is that its important to market to developers. If you can inspire the developers to love your product - it's only natural that it will gain more traction. With a price of 12K and no free trial (CD by mail) - good luck on getting developer support.

Of course, as an independent consultant, I probably have a scewed perspective. Maybe the corporate drones like getting their development platform and tools shoved down their throat.

Posted in Java at Mar 29 2004, 07:36:10 AM MST 9 Comments

SiteMesh passed the 10 minute test

I decided to go out on a limb this evening and give SiteMesh a run for its money. The first warning sign was that the documentation refers to version 2.0.2, while the downloads section refers to version 2.0.1. So I proceeded to download 2.0.1. I promptly noticed that the install guide indicated I needed to download SiteMesh's two TLDs and configure them in my web.xml. Blech - this is so year 2000 - most modern containers support loading taglibs from JAR files with a URI.

So I did a good ol' cvs co of sitemesh from java.net. First of all, I'd like to say kudos to java.net and their CVS repositories - they've been rock solid for the few weeks I've used them. After checking out sitemesh, the first thing on my agenda was to give it the tried n' true ant test. This means I navigate to the sitemesh folder and simply type "ant". At this point, I should get one of two things - a BUILD SUCCESSFUL with a JAR or a help message telling me what I should type. I got the former, which I prefer.

After this, I integrated it into my app using the decorators documentation and deployed it. At first, I received the lovely ol' "getOutputStream() has already been called for this response" error, so I hacked PageFilter.java to use PrintWriter writer = response.getWriter(); instead of PrintWriter writer = new PrintWriter(response.getOutputStream());. Build, copy, package, deploy and voila - it all worked!! Wow that was easy. ;-)

Here's the weird part. I decided to reverse my hack on PageFilter.java to prove that I'd actually fixed the bug. Now I'm back to the original code I got from CVS and I can't get the getOuputStream() error to rear its ugly head. Doh!! This experience begs the following question.

Is SiteMesh stable enough on Tomcat 5 that I can should use it in my Spring Live sample app?

SiteMesh definitely passed my 10 minute test, we'll see if it holds up for the long haul. So far, I'm quite impressed with its easy configuration and quick implementation. I especially like that you can literally guess at it's syntax and you'll get it right. Maybe I was just lucky... heh

P.S. You should probably know I'm a big fan of Tiles. I wonder if SiteMesh will let me switch a decorator on the fly like Tiles does?

Posted in Java at Mar 24 2004, 12:07:56 AM MST 16 Comments

No more Struts in services layer

Yesterday, I did some more refactoring on AppFuse and got rid of Struts in AppFuse's services layer. Basically, I was using business delegates (a.k.a. Managers) to convert POJOs -> ActionForms and vise versa. So now the question is - why do I even need Managers and why don't I just talk directly to DAOs (as most sample webapps do)? I think the best justification is that Managers can be used by rich client apps and it abstracts the DAO implementation a bit more.

The question is - is there any point to using Managers in a webapps that will always be webapps (no rich client)? To be honest, probably not - but it does make for easy testing of the business logic. The main reason I did a Struts-purge is to get ready for adding other MVC options - most of which allow me to use POJOs in my view. I'm looking forward to adding Spring and WebWork support and I'm willing to bet these solutions will be a bit cleaner. Unfortunately, neither of these frameworks offer client-side validation support, but the good news is it's coming.

The best part about yesterday's refactoring? I ended up deleting more code than I added - which is always a good thing.

Posted in Java at Mar 18 2004, 06:58:16 PM MST 16 Comments

One Year Ago - Wrox goes under

Pro JSP, Third EditionI was on vacation at my sister's when I found out. I'd just finished the final edits on my chapters and it was time to party. But then, one year ago today, I read (via weblogs) that Wrox was going under. Today, it's nice to look back and see that Pro JSP did get published.

You'd think after 6 months, we'd start to see some royalties. Nope. Nothing. Maybe it's not selling enough copies for the authors to get our $5/year cut. ;-)

Posted in Java at Mar 15 2004, 11:10:00 AM MST 10 Comments

[Struts Menu] Building Dynamic Menus from a database table

I spent a few hours this weekend and did some work on Struts Menu. At the very least, I made it easier to build dynamic menus programmatically and put together an example of doing it from a database table. I also added support for Expression Language (EL) syntax in all the tag's attributes. For the EL implementation, I simply copied what was implemented in the DisplayTag. I don't know that it's the best way (two TLDs, subclassing tag classes), but it works and it is good enough for now. The main reason I copied the implementation in the DisplayTag is that we've been talking about adding support for OGNL. I figure if I copy the implementation, it should be easy enough to copy the refactorying if/when it happens.

Back to the point of this post - how do you build dynamic menus? So without further ado, here's how to build and display database-driven menus with Struts Menu.

Posted in Java at Mar 14 2004, 04:53:33 PM MST 4 Comments

[DisplayTag] Changing a row's CSS class based on values in the row.

One request I've seen on the displaytag-user list a few times is the ability to change a <tr>'s CSS class based on a certain value. While the displaytag doesn't have this feature out-of-the-box, it is possible (and fairly easy) to do. All you need to do is sprinkle a little JavaScript into the mix. Basically, the displaytag will render a well-formed HTML table - like the following:

Username First Name Last Name
mraible Matt Raible
tomcat Tomcat User

By adding an "id" attribute to your table (i.e. id="user"), your table will get an "id" attribute and now you can easily access it via the DOM. The following JavaScript will grab the table and search the first column for a value of 'mraible' - and if found, it will change the row's background color to red.

<script type="text/javascript">
<!--
    var table = document.getElementById("user");    
    var tbody = table.getElementsByTagName("tbody")[0];
    var rows = tbody.getElementsByTagName("tr");
    // add event handlers so rows light up and are clickable
    for (i=0; i < rows.length; i++) {
        var value = rows[i].getElementsByTagName("td")[0].firstChild.nodeValue;
        if (value == 'mraible') {
            rows[i].style.backgroundColor = "red";
        }
    }
//-->
</script>

You could easily change rows[i].style... to rows[i].className = if you want to assign a new CSS class. Now let's see it in action (and see if your browser supports it). This has only been tested in Safari and Mozilla on OS X.

Username First Name Last Name
mraible Matt Raible
tomcat Tomcat User

Other displaytag tips: Static Headers HowTo and Highlight and allow clicking of rows. The 2nd tip (highlighting) is available in AppFuse, in the userList.jsp page.

BTW, I also added support for the DisplayTag to render the results from JSTL's SQL Tag. I haven't committed it yet - I'm still waiting for more feedback.

Posted in Java at Mar 08 2004, 01:22:34 PM MST 10 Comments

AppFuse 1.4 Released!

This release involves many changes: re-arranging packages/directories, Spring integration, Remember Me refactorings and I also added iBATIS as a persistence option. I also spent a lot of time going through the tutorials to make sure they are up to date. I've been using AppFuse 1.4 for a few weeks on my current project, and I really do like the way Spring makes it easy to configure Hibernate, Transactions and Interface->Implementation relationships. If you're interested in upgrading your AppFuse 1.x app to use Spring, you can checkout this howto.

I also made the leap and moved the AppFuse project from SourceForge to java.net. This is mainly so I have more control over mailing lists and adding other developers. As of today, CVS files in SourceForge and Java.net are the same - but I'll only be updating Java.net from here on out. I also have released files in both projects, but will only use java.net in the future.

I spent all weekend updating the tutorials and fixing release-related issues. Phew - I'm glad that's over. "So," you ask, "what's next?"

A week of vacation (my sister flies in tomorrow), followed by starting to write Spring Live and creating a Spring MVC option for AppFuse. Oh yeah, I'll also be at SD West in Santa Clara, CA - let me know if you plan on attending.

Posted in Java at Mar 01 2004, 12:35:54 AM MST 11 Comments

No Fluff Just Stuff

I had lunch today with Jay Zimmerman of No Fluff Just Stuff. I always enjoy getting together with Jay because he's from Montana and Montanans are generally nice folks. Among other things, he asked if I would be interested in speaking at a NFJS event or two. I said I'd think about it. However, I'm strongly considering it since it would probably be a good marketing tool.

I probably wouldn't do any events until sometime this summer. Now I just have to figure out what I'd speak on...

Posted in Java at Feb 26 2004, 01:46:06 PM MST 6 Comments