Vita Rara: A Life Uncommon

Open That Bottle Day


Categories:

Several years ago I heard about a special, but little know, holiday, "Open That Bottle Day." I remember the date as being February 28, but it might have been the last day of February. I immediately added it as a recurring event on my calendar, and have celebrated it with a little regularity over the past few years.

So, you ask, what is "Open That Bottle Day?" Well, do you have a bottle of wine that has been sitting around for years? You're just waiting for that "special occasion" to open it? Well, here it is, "Open That Bottle Day!"

Open That Bottle Day is a day top open that special bottle of wine for no other reason than to enjoy it and share with friends.

Getting a Transactional EntityManager in a JpaDaoSupport Derived DAO


Categories: | |

In Quadran my Data Access Objects (DAO) are descendants of JpaDaoSupport. JpaDaoSupport provides nice one liner convenience methods for finding entities and such. Sometimes though I find I need to actually get a handle to a JPA EntityManager. If you do this, and you are using Spring's transaction support it is important that you get the EntityManager in the proper way. Otherwise you will get an EntityManager that is not bound to the transaction, and will not be closed when your transaction completes and commit its changes, or close the session.

When I first tried getting an EntityManager I used the following code:

I used to be...


Categories:

So, I Google'd myself today. I was particularly drawn to a post I made some years ago to the Linux Kernel Mailing List. I used to be one intemperate jerk at times. That was about 11 years ago. I've changed a lot and become a lot more accepting of things.

Groovy Struts: Spring AOP Issues


Categories: | | | |

On the Spring forum we've been having a lively discussion about AOP support for scripted beans. Rick Evans has said the issues are not fundamental, and that he would be addressing them in the next few weeks.

I find this quite exciting. I'm really looking forward to a day when I can start my application server and just code. I'd really like to get rid of most, if not all, of the restarts.

Groovy Struts Update


Categories: | | | | |

(NB: For the latest on the subject see: Groovy Works.

I worked with using Spring to instantiate the action beans today, and that didn't go too far. I started getting an exception from AspectJ. (See thread on the Spring forum.)

So, I got to thinking. What if I created the GroovyClassLoader in Struts 2 prior to initializing the Spring context, and make the GroovyClassLoader the parent of the Spring context. This works! Finally something that works. It's not really enough though, and it's very cludgy. I would have to have two source trees, one of Groovy files that need to be compiled ahead of time, and one of others that are compiled and loaded at run time. That would make for a messy project in my eyes.

Struts 2 General Availability Release Is Out


Categories:

As announced on the Struts Users mailing list, Struts 2 release 2.0.6 has been given the "General Availability" thumbs up by the Struts developers.

This is the culmination of a lot of work by the Struts developers in bringing the WebWork code base into the Apache process and evolving it to create an elegant extensible framework. Congratulations to the Struts developers.

I've been working with Struts 2 since the 2.0.1-SNAPSHOT, and have found it to be a great framework. Go check it out.

Toward a Groovy'er Struts 2


Categories: | | | |

See latest update: Groovy Works

A further update is available here.

Last week I started implementing my Struts 2 actions in Groovy. After a few days I decided I liked Groovy, but I wanted more. I didn't want to have to restart my servlet container every time I recompiled a class. I just wanted to be able to edit, save, and reload in my browser.

I researched using Spring to instantiate my actions, but Spring's scripting integration only supports singletons. So, to get around this I extended the Struts 2 Spring Plugin to integrate the GroovyClassLoader. That created problems with Spring's use of AspectJ's pointcuts to support declarative transactions. (Thread on Spring forum.)

File Attachments Now Working


My apologies. I had the site mis-configured, and not listing files attached to article to anonymous users. It's fixed now.

Mark

Web Page Data Models: Where do they go? Part II


Categories: | |

Well, I finally decided where they go. At least for the Quadran project. My package structure looks like this:

Creating a Struts 2 Action in Groovy


Categories: | | | |

(N.B.: For the latest on Struts 2 and Groovy see: Groovy Works)

Actions in Struts 2 are POJO's. Actions also serve the same purpose of the ActionForm from Struts 1, storing all of the data submitted by your user. Additionally Struts 2 action classes store the information you wish to display back to your user. (NB: Struts 2 also supports a ModelDriven style, where the Action does not need to store this data, but the ideas are largely the same.)

Over the course of developing a Struts 2 application you will write a lot of accessors, setThis(String in), getThat(). Personally I'm sick of writing those methods. Yes, I know Eclipse could write them for me, but I don't like Eclipse, and I haven't taken the time to learn another IDE. I like my Unix shell, maven, screen and vi (vim), thank you very much.