0
点赞
收藏
分享

微信扫一扫

Linux使用Libevent库实现一个网页服务器---C语言程序

慕容冲_a4b8 2024-04-21 阅读 9

文章目录


视频地址

1. java体系模板引擎介绍

在这里插入图片描述

2. 使用

2.1 初步使用

  • 引入依赖
 <dependency>
            <groupId>org.thymeleaf</groupId>
            <artifactId>thymeleaf</artifactId>
            <version>3.0.9.RELEASE</version>
</dependency>
  • 初步使用
@Test
    public void fun01() {
        //创建模板引擎
        TemplateEngine templateEngine = new TemplateEngine();
        //准备模板
        String input = "<input type='text' th:value='hellothymeleaf'/>";
        //准备数据,使用context
        Context context = new Context();
        //调用模板引擎,处理模板和数据
        String out = templateEngine.process(input, context);
        System.out.println("结果数据:" + out);
    }
举报

相关推荐

0 条评论