wdragon
Nov 18th, 2008, 11:43 PM
Hi guys - I'm trying to use a specific date format for Spring. The default as most of you know is yyyy-MM-dd and I want it to be dd-MM-yyyy.
I've been around on the web for 2 days looking at solutions and trying to understand the mechanics of it all. But now I've seem to hit a brick wall.
The issue is I know it is quite easy to write my own initBinder method in a controller to do all this. However, our system is not designed with a normal controller. We are using a flowcontroller which would be fine if we were using formActions but again it has been designed without formActions.
How it is strung together is with the StereoType Annotation: Service (org.springframework.stereotype.Service)
So the start of the code looks something like this:
..
@Service("companyAction")
public class CompanyAction
..
I'm don't fully understand the StereoType annotation: Service but from what I can gather it does most of the default auto binding for you and behaves much like a component.
So my problem is I can't find a way to start injecting code in that will help me change the default date format that spring expects. Some thing on the lines of initBinder.
Thanks!
I've been around on the web for 2 days looking at solutions and trying to understand the mechanics of it all. But now I've seem to hit a brick wall.
The issue is I know it is quite easy to write my own initBinder method in a controller to do all this. However, our system is not designed with a normal controller. We are using a flowcontroller which would be fine if we were using formActions but again it has been designed without formActions.
How it is strung together is with the StereoType Annotation: Service (org.springframework.stereotype.Service)
So the start of the code looks something like this:
..
@Service("companyAction")
public class CompanyAction
..
I'm don't fully understand the StereoType annotation: Service but from what I can gather it does most of the default auto binding for you and behaves much like a component.
So my problem is I can't find a way to start injecting code in that will help me change the default date format that spring expects. Some thing on the lines of initBinder.
Thanks!