zoukankan      html  css  js  c++  java
  • 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、明日任务

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

  • 相关阅读:
    leetcode 567 滑动窗口
    田忌赛马
    去除CSDN无用的打印边框,显示数据
    操作系统博客清单
    OpenKiwi学习笔记
    开源minigui移植
    嵌入式GUI总结
    short int 变量的取值范围
    68 进程等待机制的实现 下
    67 进程等待机制的实现 上
  • 原文地址:https://www.cnblogs.com/lx06/p/14761031.html
Copyright © 2011-2022 走看看