Spring实战(第四版)读书笔记16——视图解析器

SpringMVC定义了一个名为ViewResolver的接口:

public interface ViewResolver{
    View resolverViewName(String viewName, Locale locale) throws Exception;
}

View接口:

public interface View{
    String getContentType();
    void render(Map<String, ?> model,
                HttpServletRequest request,
                HttpServletResponse response) throws Exception;
}

Spring自带了13个视图解析器,能够将逻辑视图名转换为物理实现:

 

猜你喜欢

转载自blog.csdn.net/Nemoosi/article/details/107416166