I have specific requirement that for certain form in my application, should be saved in capital letter in the database due to compatibility with legacy system. Looking thru the various solution, I found two feature in Spring Web-MVC which can help in achieving this:
- Spring Converter SPI and register it using WebMVC Configuration
- Custom PropertyEditor and attach it using WebDataBinder API.
First approach converts everything to uppercase, as it is registered at the application level and I want to restrict it to certain form only.
Second approach can be applied to hand picked controller.
Both of them works. However for second approach, I dont want my custom PropertyEditor to be called during rendering phase. It needs to be invoked only when form is getting submitted. And I am looking for a solution which can address it.
Just to be sure, solution need not stick to one of the above mentioned approach. Also, I want to avoid JavaScript listeners on Input field to convert everything in the capital letters, as I dont think that would be rite thing to do.