Vita Rara: A Life Uncommon

Struts 2

Walking into the Light: A Week With Ruby on Rails


Categories: |

This past week or so two developers whom I greatly respect and admire really opened my eyes. It's been an interesting time since then. On October 23 on the Struts Developer list Craig McClanahan wrote:

Why the long winded diatribe? Because while I'd *love* to see life made simpler for Java web developers, and a lot of the things happening in Struts2 are going that way -- it won't be me doing it. I've gone over to the dark side :-) and much prefer to develop in Rails -- for the conciseness mentioned above, but also because I don't ever have to do a "build" or "deploy" step during my development cycle any more. But you guys and gals need to be reminded that *this* is the kind of thing you are competing against if you expect to attract Rails developers ... or to avoid even more "previously Java web developer" defectors like me :-).

To which Ted Husted followed up:

Personally, I'd characterize going over to Rails as walking into the light :)

ApacheCon Training Session: Using Groovy with Struts 2


Categories: | | |

On Tuesday, November 13 I will be presenting a training session at ApacheCon 2007 in Atlanta, GA, Using Groovy with Struts 2. Learn how to use Groovy with Struts 2. Topics covered will include: Integrating Groovy into the Struts 2 Maven archetype; implementing actions, and service beans in Groovy; using Spring to wire Groovy service beans and action classes; using dynamic Groovy actions that do not require a server restart; writing Data Access Objects in Groovy and using Spring based transaction support with Java Persistence API (JPA).

Groovy Works 0.1 Release


Categories: | | |

Groovy Works has been the benefactor of a lot of development this past week. With upgrades for better class caching, better utilization of the GroovyClassLoader, and integration with Groovy-1.1-beta-3-SNAPSHOT and Spring 2.

Google Code Project and SVN Access

I have moved Groovy Works to Google Code. To get the latest release please see the download section on Google.

Quick Start Directions

  • Download the current release from Google Code.
  • Unzip it in a directory: tar xfzv groovyworks-0.1.tar_.gz
  • Change directory to the groovyworks-core directory: cd groovyworks-core
  • Install the Groovy Works artifact with Maven: mvn install
  • Change directory to the sample application: cd ../example-app
  • Run the application with the Jetty plugin: mvn jetty:run
  • Point your browser at http://localhost:8080/groovyworks/

To use the plugin in your Struts projects you'll need to remove the standard Struts Spring plugin. Groovy Works provides all of the functionality of the existing Spring plugin.

The More I Use Struts 2 the More I Like It


Categories:

It's a quiet Saturday and I'm working. Yea, I know some people would scoff at that, but lately my office and business life during the week are so hectic I can't get into that "place" where development just flows.

Well, today I'm the only one in the office and I'm getting development done. I'm tackling a very tricky screen in Quadran, and Struts 2 is making it a joy. The more I use Struts 2 I realize that a lot of development and thought has gone into solving real web developer needs. When I think of some new feature I'd like in Struts 2 I frequently find that it's already there.

I've started using the "method" property on submit buttons. I know I'm late to the party. This is just so neat. I used to use hidden properties and switches to get to the right logic. Now, just set method on the <s:submit> tag, and voila! I'm in the right place in my action.

ApacheCon US 2007: Using Groovy with Struts 2


Categories: | | | |

I received an email from ApacheCon today. They have accepted my Using Groovy with Struts 2 training session.

Using Groovy with Struts 2: A hands on half day training session. Learn how to use Groovy with Struts 2. Topics covered will include: Integrating Groovy into the Struts 2 Maven archetype; implementing actions, and service beans in Groovy; using Spring to wire Groovy service beans and action classes; using dynamic Groovy actions that do not require a server restart; writing Data Access Objects in Groovy and using Spring based transaction support with Java Persistence API (JPA).

I don't have scheduling information yet, but I believe it will either be on November 12 or 13. Stay tuned for more information.

What would you want in a Struts 2 cookbook?


Categories:

I'm seriously considering writing a dead tree Struts 2 cookbook. What types of recipes would you like to see? Beyond what is already in my cookbook I've been thinking of the following:

  • Integration with other tools:
    • Spring & Spring MVC
    • Hibernate, iBatis, JPA
    • JSF (integration and migration)
    • Guice
    • SiteMesh
    • Others?
  • Architecture
    • Using "modules" to break up a large project
    • Using layers
    • Using Spring as architectural glue

Creating a Login Interceptor in Struts 2


Categories: | |

Controlling access to web resources with a a login process is a common use-case. Implementing this using an interceptor in Struts 2 is very straight forward.

The parts of the solution:

  • An interceptor class,
  • An interceptor definition in our struts.xml file,
  • An interceptor stack that uses our interceptor in our struts.xml file,
  • A global result in our struts.xml file,
  • A JSP page to accept the username and password,
  • A service bean to process our user's login attempt,
  • A way to wire our service bean to our interceptor.

ApacheCon 2007 US Submissions


Categories: | | |

I've submitted three proposals for talks at ApacheCon 2007 US, login to see the proposed sessions and give feedback on them.

I've never submitted a proposal to do a presentation at a technical conference before. So, this is a first. I've done a lot of training and mentoring, but never worked for an employer who saw sharing the knowledge as something of value they wanted their employees doing. (It's good to be self-employed now!)

Post and Redirect in Struts 2


Categories: | |

Redirecting a user of a web application after submitting an HTTP POST is a common pattern. A common use case is to redirect to a display page after a user has created something, such as a purchase order or sales order.

This post and redirect pattern is supported by Struts 2. The means of doing this wasn't obvious to me, but some reading and searching turned up the answer. There are some examples around for doing a redirect using static parameters, but that doesn't help when you want to redirect someone say to display the order they just placed on your website.

Redirects in Struts 2 can use static or dynamic parameters. Here's a simple static redirect:

The Definitive Guide to Grails


Categories: | | |

I picked up a copy of The Definitive Guide to Grails this week. I'm most of the way through it, and I'm impressed. The Grails team has definitely done a lot of work. As a result I've started to dig into the code, and I'm getting a lot of ideas for Groovy Works.

Overall I highly recommend getting a copy of the book, whether you use Grails or not. It is well worth a look.

I'll post more thoughts when I finish the book.

Syndicate content