资源简介

本资源对应博文:https://blog.csdn.net/zhq505824802/article/details/81148859,可以通过博文进行学习,不建议下载完整源码,博文有详细教程,以及代码。
数据库表 配置请查看原文介绍

资源截图

代码片段和文件信息

package com.zhq.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONobject;
import com.zhq.pojo.User;
import com.zhq.service.UserService;
import com.zhq.util.PageBean;
import com.zhq.util.ResponseUtil;
import com.zhq.util.StringUtil;
import org.apache.commons.io.FileUtils;
import org.apache.log4j.Logger;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping(“/user“)
public class UserController {
    private static Logger log= Logger.getLogger(UserController.class);
    @Resource
    private UserService userService;

    @RequestMapping(“/showUser.do“)
    public String toIndex(HttpServletRequest requestModel model){
        System.out.println(“liuhaitest“);
        return “showUser“;
    }
    // /user/test.do?id=1
    @RequestMapping(value=“/test.do“method=RequestMethod.GET)
    public String test(HttpServletRequest requestModel model){
        int userId = Integer.parseInt(request.getParameter(“id“));
        System.out.println(“userId:“+userId);
        User user=null;
        if (userId==1) {
            user = new User();
            user.setAge(11);
            user.setId(1);
            user.setPassword(“123“);
            user.setUserName(“javen“);
        }
        log.debug(user.toString());
        model.addAttribute(“user“ user);
        return “index“;
    }
    // /user/showUser.do?id=1
    @RequestMapping(value=“/showUser.do“method=RequestMethod.GET)
    public String toindex(HttpServletRequest requestModel model){
        int userId = Integer.parseInt(request.getParameter(“id“));
        System.out.println(“userId:“+userId);
        User user = this.userService.getUserById(userId);
        log.debug(user.toString());
        model.addAttribute(“user“ user);
        return “showUser“;
    }

    // /user/showUser2.do?id=1
    @RequestMapping(value=“/showUser2.do“method=RequestMethod.GET)
    public String toIndex2(@RequestParam(“id“) String idModel model){
        int userId = Integer.parseInt(id);
        System.out.println(“userId:“ + userId);
        User user = this.userService.getUserById(userId);
        log.debug(user.toString());
        model.addAttribute(“user“ user);
        re

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-07-21 09:24  mavenDemo\
     目录           0  2018-07-21 23:11  mavenDemo\.idea\
     文件           9  2018-07-18 16:47  mavenDemo\.idea\.name
     目录           0  2018-07-21 09:24  mavenDemo\.idea\artifacts\
     文件         293  2018-07-18 16:52  mavenDemo\.idea\artifacts\mavenDemo_war.xml
     文件        4014  2018-07-21 09:24  mavenDemo\.idea\artifacts\mavenDemo_war_exploded.xml
     文件        1194  2018-07-21 02:38  mavenDemo\.idea\compiler.xml
     目录           0  2018-07-18 16:47  mavenDemo\.idea\copyright\
     文件          76  2018-07-18 16:47  mavenDemo\.idea\copyright\profiles_settings.xml
     文件         294  2018-07-18 16:52  mavenDemo\.idea\encodings.xml
     目录           0  2018-07-21 11:13  mavenDemo\.idea\inspectionProfiles\
     文件      271916  2018-07-21 11:13  mavenDemo\.idea\inspectionProfiles\Project_Default.xml
     文件         241  2018-07-19 09:36  mavenDemo\.idea\inspectionProfiles\profiles_settings.xml
     目录           0  2018-07-21 04:33  mavenDemo\.idea\libraries\
     文件         559  2018-07-18 17:13  mavenDemo\.idea\libraries\Maven__aopalliance_aopalliance_1_0.xml
     文件         559  2018-07-18 17:13  mavenDemo\.idea\libraries\Maven__com_alibaba_fastjson_1_1_41.xml
     文件         570  2018-07-21 02:21  mavenDemo\.idea\libraries\Maven__com_sun_mail_javax_mail_1_5_0.xml
     文件         581  2018-07-18 17:13  mavenDemo\.idea\libraries\Maven__commons_codec_commons_codec_1_9.xml
     文件         584  2018-07-18 17:13  mavenDemo\.idea\libraries\Maven__commons_dbcp_commons_dbcp_1_2_2.xml
     文件         650  2018-07-18 17:13  mavenDemo\.idea\libraries\Maven__commons_fileupload_commons_fileupload_1_3_1.xml
     文件         548  2018-07-18 17:13  mavenDemo\.idea\libraries\Maven__commons_io_commons_io_2_4.xml
     文件         617  2018-07-18 17:13  mavenDemo\.idea\libraries\Maven__commons_logging_commons_logging_1_1_3.xml
     文件         570  2018-07-18 17:13  mavenDemo\.idea\libraries\Maven__commons_pool_commons_pool_1_3.xml
     文件         572  2018-07-21 02:21  mavenDemo\.idea\libraries\Maven__javax_activation_activation_1_1.xml
     文件         528  2018-07-21 02:21  mavenDemo\.idea\libraries\Maven__javax_javaee_api_7_0.xml
     文件         482  2018-07-18 17:13  mavenDemo\.idea\libraries\Maven__jstl_jstl_1_2.xml
     文件         500  2018-07-18 16:52  mavenDemo\.idea\libraries\Maven__junit_junit_4_11.xml
     文件         514  2018-07-18 17:13  mavenDemo\.idea\libraries\Maven__log4j_log4j_1_2_17.xml
     文件         619  2018-07-18 17:13  mavenDemo\.idea\libraries\Maven__mysql_mysql_connector_java_5_1_30.xml
     文件         651  2018-07-18 17:13  mavenDemo\.idea\libraries\Maven__org_codehaus_jackson_jackson_core_asl_1_9_13.xml
     文件         665  2018-07-18 17:13  mavenDemo\.idea\libraries\Maven__org_codehaus_jackson_jackson_mapper_asl_1_9_13.xml
............此处省略2483个文件信息

评论

共有 条评论