栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

SpringBoot + MyBatis + Thymeleaf 之 HelloWorld

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

SpringBoot + MyBatis + Thymeleaf 之 HelloWorld

目录

■相关知识

■代码

UserController2

helloThymeleafMyBatis.html

■效果

■DB数据


■相关知识

SpringBoot + MyBatis 之 Hello World_sun0322-CSDN博客

SpringBoot + Thymeleaf 之 HelloWorld_sun0322-CSDN博客

■代码

UserController2
package com.sxz.test.one.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.sxz.test.one.entity.User;
import com.sxz.test.one.service.UserService;

@Controller
@RequestMapping("/user")
public class UserController2 {

    @Autowired
    UserService userService;

    @RequestMapping("/findAll2")
    public String findAll(Model model){
    	
    	List userList = userService.findAll();
    	model.addAttribute("userList",userList);
    	
    	return "helloThymeleafMyBatis.html";
    	
    }
}

helloThymeleafMyBatis.html




    
    helloThymeleafMyBatis页面
    
       table { background:#DCDFE6; width: 100%; }
       table th { background:#DDEBF7; }
   	   table tbody td { background:#FFFFFF; }
    



	
id password 权限

■效果

 

■DB数据

 

---

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/310500.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号