File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes initBinder method - how does it works? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "initBinder method - how does it works?" Watch "initBinder method - how does it works?" New topic
Author

initBinder method - how does it works?

Pradeep Arun
Greenhorn

Joined: Dec 28, 2007
Posts: 19
Hi,

I am bit confused with initBinder method available in Spring.

How it works?
Whats the use of it?
In what scenario should we use it?

I have a textbox which is tied to java.util.Date property in CommandBean. I used the below code for binding

protected void initBinder(HttpServletRequest request,
ServletRequestDataBinder binder) throws Exception {
binder.registerCustomEditor(Date.class,
new CustomDateEditor(new SimpleDateFormat("yyyy-MM-dd"), false));
}

But when i enter 02/12/2009 or any text value its not throwing any error message. if i enter 02-12-2009 it works. I am totally confused

Please clarify.

Thanks,
Pradeep
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: initBinder method - how does it works?
 
Similar Threads
javax.el.ELContext.getFunctionMapper().resolveFunction() returns null always using JBoss/4.2.3
javax.el.ELContext.getFunctionMapper().resolveFunction() returns null always using Tomcat/6.0.10
javax.el.ELContext.getFunctionMapper().resolveFunction() returns null always using Tomcat/6.0.10
JDK malfunction
How to get aroun LazyInitialization exceptions using Spring HibernateDaoSupport?