views:

29

answers:

0

Currently i am using paging on my page which uses MultiActionController which displays a jsp page perfectly , on the same page now i want to validate a simple textfield (input/form:input) also want to retrieve name and id from a dropdown(Select option) once a link is clicked. Simple !!

Two questions

  1. Can i use a class implements Validator? and inject it same way as simpleformcontroller in config or some other way within the controller? How? example please?

  2. Can i use java bean in jsp -> i always get error of binding, how to indicated controller to use this bean? i have have passed as argument to my method add and also tried overriding newCommandObject

Controller.java

public ModelAndView add(HttpServletRequest request, HttpServletResponse response,  Person person) throws Exception { 

         return new ModelAndView("userpage"); 
    } 

@Override 
    protected Object newCommandObject(Class clazz) 
    throws Exception {

         return new Person();
}