How SSM initializes index.jsp or index.ftl pages

how should I open the index implementation on the home page of the website to query the relevant data from the background database and then bind it to the page?


Map to a method through index, and return the data that ModelAndView,Model is queried, View is a page that jumps, and jsp can obtain the data in Model.

@RequestMapping("/index")
public ModelAndView index(){
    ModelAndView mav = new ModelAndView();
    //
    //mav.setView();
    return mav;
}
Menu