2.模板引擎FreeMarker

模板引擎FreeMarker

①创建新项目,选择FreeMarker模板引擎和devTools开发工具和web依赖

②新建WebController文件和index模板文件

WebController.java

src/main/resources/templates/index.ftl

③启动测试,title已进行了解析

http://localhost:8080/web/index

其他

使用Jquery

pox.xml中加入jquery依赖

网页中加入即可使用

使用图片或css文件

放入src/main/resources/static 即可

比如

模板中使用:

手动直接引入依赖

修改pom.xml,添加如依赖

Last updated

Was this helpful?