dimanche 29 mars 2015

spring mvc note able to display my page

I am having problem when displaying new page from controller. Here when i return modelandview object it come to login page(login.jsp) but when i return string it display correct page(admin.jsp).


Returning ModelAndView..



if (bean.getUserName().equalsIgnoreCase("rohit") && bean.getPassWord().equalsIgnoreCase("rawat"))
{
AdminHomeBean admin = new AdminHomeBean();
return new ModelAndView("admin/admin", "adminHbean", admin);
}
else
{
bean.setErrorMsg("User Name or Password is Incorret");
return new ModelAndView("login/login", "loginbean",bean);
}


This method always returns the login page.


Return String..


return "admin/admin";


This works fine. and return admin page.


Please help..


Aucun commentaire:

Enregistrer un commentaire