本文整理匯總了Java中org.springframework.web.servlet.view.InternalResourceViewResolver.setContentType方法的典型用法代碼示例。如果您正苦於以下問題:Java InternalResourceViewResolver.setContentType方法的具體用法?Java InternalResourceViewResolver.setContentType怎麽用?Java InternalResourceViewResolver.setContentType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.springframework.web.servlet.view.InternalResourceViewResolver
的用法示例。
在下文中一共展示了InternalResourceViewResolver.setContentType方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setupViewResolver
import org.springframework.web.servlet.view.InternalResourceViewResolver; //導入方法依賴的package包/類
@Bean
public InternalResourceViewResolver setupViewResolver() {
InternalResourceViewResolver resolver = new InternalResourceViewResolver();
resolver.setPrefix("/");
resolver.setSuffix(".jsp");
resolver.setContentType("text/html; charset-utf-8");
resolver.setViewClass(JstlView.class);
return resolver;
}
示例2: viewResolver
import org.springframework.web.servlet.view.InternalResourceViewResolver; //導入方法依賴的package包/類
@Bean
public InternalResourceViewResolver viewResolver() {
InternalResourceViewResolver internalResourceViewResolver = new InternalResourceViewResolver();
internalResourceViewResolver.setOrder(1);
internalResourceViewResolver.setContentType("text/html; charset=utf-8");
internalResourceViewResolver.setSuffix(".jsp");
internalResourceViewResolver.setPrefix("/WEB-INF/view/");
return internalResourceViewResolver;
}
示例3: getViewResolver
import org.springframework.web.servlet.view.InternalResourceViewResolver; //導入方法依賴的package包/類
@Bean
public ViewResolver getViewResolver(ResourceLoader resourceLoader) {
InternalResourceViewResolver InternalResolver = new InternalResourceViewResolver();
InternalResolver.setPrefix("/html/");
InternalResolver.setSuffix(".html");
InternalResolver.setCache(false);
InternalResolver.setContentType("text/html;charset=ISO-8859-1");
return InternalResolver;
}