• 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、明日任务

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

  • 相关阅读:
    makeObjectsPerformSelector 方法的用法
    UISearchBar控件
    iOS应用崩溃日志分析
    IOS崩溃日志分析
    iOS 中捕获程序崩溃日志
    iOS疯狂详解之imageIO完成渐进加载图片
    iOS中nil,NULL,Nil,NSNull的区别
    IOS 8 UITableView cell lines不能靠左解决方法
    Android小玩意儿-- 从头开发一个正经的MusicPlayer(三)
    Android小玩意儿-- 从头开发一个正经的MusicPlayer(二)
  • 原文地址:https://www.cnblogs.com/lx06/p/14761031.html
Copyright © 2020-2023  润新知