Hi..
Please correct me if I'm making a fundamental mistake... (I guess im making one...??? )
I understand that through DI, I can inject values...
But in the code there must be a context.getBean(theBeanNameWhereDependencyInjectio nIsConfigured)
Somewhere or the other in my code I would need a getBean() method invocation...
(Please tell me if im right till here...)
Looking at the API I find that it can be done using,
Code:
WebApplicationContext context;
...
context=WebApplicationContextUtils.getRequiredWebApplicationContext(theServletContext);
AccountSave accountSave=(AccountSave)context.getBean("AccountSaveDao");
But don see how I can get theServletContext in my validator..
In one other code I used
Code:
WebApplicationContext context;
...
context=WebApplicationContextUtils.getRequiredWebApplicationContext(req.getSession().getServletContext());
thus getting theServletContext thro' req object...
But here the validate method has no request object to use...