当前位置: 首页 > article >正文

Java(Springboot)

get请求

在Controller中--->从仓库里取出要用的mysql----->对于get请求(httpsession,model容器)----->从httpsession取出userid再赋值给userid----->用userid在mysql获取用户的信息------>然后用户的信息在保存在model容器里---->return到html地址里面

put请求

得到请求体的参数--->从httpsession取出userid再赋值给userid----->根据用户id查找数据库----->更新user_id里面的数据------>保存到数据库里面-----return ResponseEntity.ok

Thymeleaf 语法解释

​
<span th:text="${user.username}"></span>
<a th:href="@{/profile/{id}(id=${user.id})}">View Profile</a>
<img th:src="@{${user.profilePictureUrl}}" alt="User Profile Picture"/>
<img th:src="@{${user.profilePictureUrl}}" alt="User Profile Picture"/>
<div th:class="${user.active} ? 'active' : 'inactive'">User Profile</div>
<p th:if="${user.isActive}">User is active</p>
<p th:unless="${user.isActive}">User is inactive</p>
<ul>
    <li th:each="user : ${users}" th:text="${user.username}"></li>
</ul>
<form th:action="@{/submit}" th:object="${user}">
    <input type="text" th:field="*{username}" />
    <input type="password" th:field="*{password}" />
    <button type="submit">Submit</button>
</form>

​

123


    http://www.kler.cn/a/543298.html

    相关文章:

  • pytorch笔记:mm VS bmm
  • Hello Robot 推出Stretch 3移动操作机器人,赋能研究与商业应用
  • 计算机毕业设计——Springboot的旅游管理
  • 2.11学习记录
  • 分层耦合 - IOC详解
  • 集成右键的好用软件,支持多线程操作!
  • 使用Python爬虫获取淘宝搜索词推荐API接口
  • 人工智能加速冲击?Anthropic报告:43%的任务正被人工智能替代
  • 零基础学CocosCreator·第九季-网络游戏同步策略与ESC架构
  • Windows逆向工程入门之标志寄存器及其结构和标志位
  • Ollama本地部署DeepSeek(Mac)
  • 网络安全纵深防御体系框架 网络安全防护体系
  • 【2025新】基于springboot的问卷调查小程序设计与实现
  • 【亲测可用】Bandicam v8.1.0(班迪录屏软件)便携完整版
  • 探秘Hugging Face与DeepSeek:AI开源世界的闪耀双子星
  • 常见的排序算法:插入排序、选择排序、冒泡排序、快速排序
  • 自己动手实现一个简单的Linux AI Agent
  • 【数据结构】寻找规律:算对角线长度||杨辉三角||魔方问题(C语言实现)
  • singleTaskAndroid的Activity启动模式知识点总结
  • 做站群应该选择什么服务器?
  • C#03项目——Typeof的用法
  • 深度学习-112-大语言模型LLM之langchain的聊天模型概述和基本概念介绍
  • Golang GORM系列:GORM 高级查询教程
  • SQL Server 逻辑查询处理阶段及其处理顺序
  • tcp传输协议机制
  • 用php tp6对接钉钉审批流的 table 表格 明细控件 旧版sdk