隐藏页面特效

4.28-团队项目-每日任务-前后端链接

1、数据库链接和简单进行用户注册的相关问题

2、完成情况

数据库已连接,用户注册问题解决完成个人信息相关的录入

package com.atguigu.crud.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import com.atguigu.crud.bean.User;
import com.atguigu.crud.service.UserService;
import javax.servlet.http.HttpSession;

@Controller
@RequestMapping("/user")
public class UserController {
@Autowired
UserService userService;

@GetMapping("/edit")
public String edit(String action) {
boolean xiu;
if (action != null) {
xiu = true;
} else
xiu = false;
return "forward:/WEB-INF/jsp/user/edit.jsp?isxiugai=" + xiu;
}

@PostMapping("/edit2")
public String doedit(User user, Model model, @SessionAttribute("user") User user1, HttpSession session) {
try {
userService.modify(user);
user1.setUser_type(user.getUser_type());
user1.setNick_name(user.getNick_name());
user1.setPhone(user.getPhone());
user1.setTrue_name(user.getTrue_name());
user1.setId_card(user.getId_card());
user1.setSex(user.getSex());
user1.setQq_code(user.getQq_code());
user1.setWechat_code(user.getWechat_code());
user1.setSignature(user.getSignature());
session.setAttribute("user", user1);
model.addAttribute("msg", "保存成功");
} catch (Exception e) {
model.addAttribute("msg", "保存失败");
}
return "forward:/WEB-INF/jsp/user/edit.jsp?isxiugai=" + true;
}

@GetMapping("/head.html")
public String head() {
return "user/head";
}

}

3、明日任务

完成社团信息以及进行用户信息分类


__EOF__

本文作者往心。
本文链接https://www.cnblogs.com/lx06/p/14761031.html
关于博主:评论和私信会在第一时间回复。或者直接私信我。
版权声明:本博客转载请注明出处!
声援博主:如果您觉得文章对您有帮助,可以点击文章右下角推荐一下。您的鼓励是博主的最大动力!
posted @   往心。  阅读(40)  评论(0编辑  收藏  举报
编辑推荐:
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· AI与.NET技术实操系列(六):基于图像分类模型对图像进行分类
点击右上角即可分享
微信分享提示