enjoy 模板实在是太方便了。
整合就是这么简单,用起来就是爽歪歪!!!
@Configuration public class JFinalEnjoyConfig { @Bean public ViewResolver viewResolver() { JFinalViewResolver resolver = new JFinalViewResolver(); resolver.setBaseTemplatePath(null); resolver.setSourceFactory(new ClassPathSourceFactory()); // or // resolver.getEngine().setToClassPathSourceFactory(); resolver.setDevMode(true); return resolver; } }
此外,resolver.setSourceFactory(new ClassPathSourceFactory())
改成
resolver.setToClassPathSourceFactory();
还可再省点代码