Friday, November 7, 2008

ApacheCon US 2008 Rocked!


I am wrapping up a week in New Orleans where I met the greatest technologists on the planet! I was there to speak about Struts 2 and this was my first time at this conference so I really did not know what to expect! As a regular Java One attendee, I expected hugeness all around. When I discovered only a relatively smallish bunch, I figured I'd give my talk and hit Bourbon Street. As it turned out, this was the sweetest conference I have attended yet! Everyone was top-notch and cool enough to talk to you. I see too many techies with big heads who act like they have been on tour with Aerosmith. Many of the speakers at ApacheCon were the "head Fred's" of the major Apache projects we use every day and they openly visited about the good, bad and ugly. Bertrand Delecretaz was actually more entertaining than Steven Tyler! After his talk on "Open Source Collaboration Tools" I had learned about so many products and trends that I was reaching for more paper to write on. And Brett Porter was a better performer than Joe Perry! Granted, he wasn't wearing a Les Paul, but he made Maven sing

If you have never attended ApacheCon, I would suggest you add this to your New Year's resolutions.

Peace,
Scott

Tuesday, October 21, 2008

The Web Site

I am in the process of putting lipstick on my strutsschool.com "pig website!" In the spirit of our hugely successful Manning publication, I am launching struts2inaction.com. If you have ever been the chef, cook and bottle washer for a web site, then you already know how much work it can be. Please be patient as I transition and grow this new site.

Peace,
Scott

Monday, October 20, 2008

Struts 2 Tips & Techniques Newsletter

I am thinking about publishing a newsletter to bring you the latest Struts 2 features and techniques. I have participated in the forums and mailing lists for years and this is not always the optimum way to learn the nuggets. It would take a chunk of time to do this professionally and nobody wants to pay for anything (myself included) in this free-conomy! While I don't expect to get rich doing this, I would like to break even as the opportunity cost is high.

I'm curious to hear what you think about:
  1. Publishing frequency (weekly, monthly)
  2. Distribution format (PDF, email, print, etc.)
  3. Subscription price you would be willing to pay (monthly, weekly)
Let me know what you think.

Peace,
Scott

Thursday, October 9, 2008

Spring/JSP Interplay

A friend and I were discussing tricks of the trade and he showed me a technique to make dynamic web pages easier to deal with. The technique exposes the Spring Context in the same way as any other JSP implicit objects. Being an MVC guy, my first response was "why would you mix the chocolate with the peanut butter?" However, after I studied it awhile, his technique absolutely rocks! What is they say "necessity is the mother of all invention?"

So here are the goods...

Friday, October 3, 2008

ApacheCon in New Orleans


Have you registered for the Apache conference yet? It promises to be a great show and is always educational. Come out and learn the latest about your favorite free and open source frameworks. I'm certain that what you can't learn at the conference can be picked up on Bourbon Street!

Peace,
Scott

Friday, September 12, 2008

Orthogonal OGNL


Trying to explain OGNL to a new Struts 2 developer has its challenges. Changes in expression syntax and the whole value stack proposition can be a bit daunting. Add to this the sparse documentation and you have a recipe for confusion.

I would like to clear up the confusion by offering a visual and a brief explanation.


OGNL is the Object Graph Navigation Language (see http://www.ognl.org/ for the full documentation of OGNL). Here, we will cover a few examples of OGNL features that co-exist with the framework. To review basic concepts, refer to OGNL Basics.

The framework uses a standard naming context to evaluate OGNL expressions. The top level object dealing with OGNL is a Map (usually referred as a context map or simply context). OGNL has a notion of there being a root object within the context. In OGNL expressions, the properties of the root object can be referenced without any special "marker" notation. References to other objects are marked with a pound sign (#).

The framework sets the OGNL context to be our ThreadLocal ActionContext, and the OGNL root object to the Struts 2 value stack. The value stack is a set of several objects, but to OGNL it appears to be a single object. Along with the value stack, the framework places other objects in the ActionContext, including Maps representing the application, session, and request contexts. These objects coexist in the ActionContext, alongside the value stack.

The Action instance is always pushed onto the value stack and since the stack is the OGNL root, references to Action properties can omit the # marker.

<s:property value=“customer.address"/>
But, to access other objects in the ActionContext, we must use the # notation so OGNL knows not to look in the root object, but for some other object in the ActionContext.


<s:property value="#session.mySessionPropKey"/> or
<s:property value="#session['mySessionPropKey']"/> or
<s:property value="#request['myRequestPropKey']"/>

The ActionContext is also exposed to Action classes via a static method.

ActionContext.getContext().getSession().put("mySessionPropKey", mySessionObject);