Tuesday, January 17, 2006

SimpleFormController: onSubmit() not being called

I had a SimpleFormController and a validator. According to my logs, the command object passed validation, but I was not seeing the success-view. Upon closer inspection of the errors object in my validate method, I noticed Spring was having a problem converting the String (from the form input) to the Long property of my command class.
The solution is easy -- implement initBinder() in the controller and register a PropertyEditor.

Wednesday, January 04, 2006


Happy New Year! Most people have returned to the office.

I can't seem to find an answer as to where to place log4j.properties in an EAR file. Most sites I've read say to place it in WEB-INF/classes; I'm sure that will work fine for a WAR, but not so sure it would work for my application/business-logic code, which is a different JAR within the EAR.

I'll update later when I find out more.

Update: It seems like it works so far. One "problem" is that I'm using Maven, and was wondering how to get the properties file into WEB-INF/classes, especially since you don't create a classes directory under your WEB-INF folder. I put my log4j.properties file in src/main/resources, and Maven did the rest!