Springmmvc returns modleAndView view without jumping according to the set page

@Controller
@RequestMapping("/bangding")
public class BangdingTest {


@RequestMapping(value="/login")
public ModelAndView login(){  
   String message = "Welcome next time!";  
   System.out.println("message***************************"+message);
   return new ModelAndView("bangding/bangdingTest");  
}  
}

The jsp page mapped to is login.jsp instead of bangdingTest.jsp




 An error such as the title may be a package import error:

 When using ModelAndView to return to the view, no error may be reported in the background, but the corresponding jsp page cannot be parsed. At this time, there may be a package import error:

import org.springframework.web.portlet.ModelAndView;--wrong package
import org.springframework.web.servlet.ModelAndView;--correct package

Guess you like

Origin blog.csdn.net/qi95719/article/details/53135584