the exception info:
javax.servlet.ServletException: ModelAndView [ModelAndView: materialized View is [null]; model is {command=action.RegisterInfo@1c6572b, org.springframework.validation.BindException.comma nd=org.springframework.validation.BindException: BindException: 0 errors}] neither contains a view name nor a View object in servlet with name 'spring'
........
'spring' is my dispacherservlet name. RegisterInfo is a normal bean,it contains two properties:username and password.
my controller code:
jsp form:public class RegisterAction extends SimpleFormController//implements Controller
{
public RegisterAction()
{
setCommandClass(RegisterInfo.class);
}
protected ModelAndView onSubmit(Object cmd,BindException ex)
{
return new ModelAndView("RegisterSuccess");
}
/*
public ModelAndView handleRequest(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception
{
return new ModelAndView("RegisterSuccess");
}
*/
}
just so simple.but when i use simpleformcontroller,it generate mistake;when i change to the Controller,it is ok.<form action="register.do" method="get">
Username:<input type="text" name="username" value="" />
Password:<input type="text" name="password" value="" />
<input type="submit" value="registe" />
</form>


Reply With Quote