Java Code Examples for com.jfinal.template.ext.spring.JFinalViewResolver#setOrder()

The following examples show how to use com.jfinal.template.ext.spring.JFinalViewResolver#setOrder() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EnjoyConfig.java    From spring-boot-demo with MIT License 6 votes vote down vote up
@Bean(name = "jfinalViewResolver")
public JFinalViewResolver getJFinalViewResolver() {
	JFinalViewResolver jfr = new JFinalViewResolver();
	// setDevMode 配置放在最前面
	jfr.setDevMode(true);
	// 使用 ClassPathSourceFactory 从 class path 与 jar 包中加载模板文件
	jfr.setSourceFactory(new ClassPathSourceFactory());
	// 在使用 ClassPathSourceFactory 时要使用 setBaseTemplatePath
	// 代替 jfr.setPrefix("/view/")
	JFinalViewResolver.engine.setBaseTemplatePath("/templates/");

	jfr.setSessionInView(true);
	jfr.setSuffix(".html");
	jfr.setContentType("text/html;charset=UTF-8");
	jfr.setOrder(0);
	return jfr;
}
 
Example 2
Source File: EnjoyConfig.java    From spring-boot-demo with MIT License 6 votes vote down vote up
@Bean(name = "jfinalViewResolver")
public JFinalViewResolver getJFinalViewResolver() {
	JFinalViewResolver jfr = new JFinalViewResolver();
	// setDevMode 配置放在最前面
	jfr.setDevMode(true);
	// 使用 ClassPathSourceFactory 从 class path 与 jar 包中加载模板文件
	jfr.setSourceFactory(new ClassPathSourceFactory());
	// 在使用 ClassPathSourceFactory 时要使用 setBaseTemplatePath
	// 代替 jfr.setPrefix("/view/")
	JFinalViewResolver.engine.setBaseTemplatePath("/templates/");

	jfr.setSessionInView(true);
	jfr.setSuffix(".html");
	jfr.setContentType("text/html;charset=UTF-8");
	jfr.setOrder(0);
	return jfr;
}
 
Example 3
Source File: EnjoyConfig.java    From spring-boot-demo with MIT License 6 votes vote down vote up
@Bean(name = "jfinalViewResolver")
public JFinalViewResolver getJFinalViewResolver() {
	JFinalViewResolver jfr = new JFinalViewResolver();
	// setDevMode 配置放在最前面
	jfr.setDevMode(true);
	// 使用 ClassPathSourceFactory 从 class path 与 jar 包中加载模板文件
	jfr.setSourceFactory(new ClassPathSourceFactory());
	// 在使用 ClassPathSourceFactory 时要使用 setBaseTemplatePath
	// 代替 jfr.setPrefix("/view/")
	JFinalViewResolver.engine.setBaseTemplatePath("/templates/");

	jfr.setSessionInView(true);
	jfr.setSuffix(".html");
	jfr.setContentType("text/html;charset=UTF-8");
	jfr.setOrder(0);
	return jfr;
}
 
Example 4
Source File: SpringBootConfig.java    From sdb-mall with Apache License 2.0 5 votes vote down vote up
@Bean(name = "jfinalViewResolver")
    public JFinalViewResolver getJfinalViewRrsolver() {
        JFinalViewResolver jfr = new JFinalViewResolver();
        jfr.setDevMode(true);

        jfr.setSourceFactory(new ClassPathSourceFactory());
        jfr.setPrefix("/templates/");
        jfr.setSuffix(".html");
        jfr.setContentType("text/html;charset=UTF-8");
        jfr.setOrder(0);
//        jfr.addSharedFunction("/view/common/_layout.html");
        return jfr;
    }