• 大小: 76KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-18
  • 语言: 其他
  • 标签: ssm  

资源简介

这是ssm整合的一个小案例源代码,具体步骤去找我的博客中的文章https://blog.csdn.net/weixin_41664173/article/details/81536030 希望对你有帮助

资源截图

代码片段和文件信息

package com.ssm.controller;

import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.Part;

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellstyle;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.sl.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.DateUtil;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
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 com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mysql.jdbc.Field;
import com.ssm.model.User;
import com.ssm.service.UserService;

import Excel.ExportExcel;

@Controller
@RequestMapping(“/user“)
/**
 * 描述:用户controller

 * 创建人:

 * 时间:2018年5月17日

 * @version
 */
public class UserController {

    private static final List UserService = null;
@Autowired
    private UserService userService;  
private User user;

    /**
     *跳转到添加用户界面
     */
    @RequestMapping(“toAddUser“)
    public String toAddUser(){
        return “addUser“;
    }

    /**
     * 添加用户并重定向  
     * @param model
     * @param user
     * @return
     */
    @RequestMapping(“addUser“) 
    public String addUser(Model modelUser user){
        if(user != null){
            userService.saveUser(user);
        }
        return “redirect:/user/userInfo“;
    }

    /**
     * 修改用户
     * @param model
     * @param request
     * @param user
     * @return
     */
    @RequestMapping(“updateUser“)  
    public String UpdateUser(Model modelUser user){
     System.out.println(“user=“+user);
             if(userService.updateUser(user)){  
                    user = userService.findUserById(user.getId());  
              

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-05-23 16:01  SsmDemo\
     文件        1445  2018-05-17 15:15  SsmDemo\.classpath
     文件        1216  2018-05-17 15:14  SsmDemo\.project
     目录           0  2018-05-17 15:13  SsmDemo\.settings\
     文件         639  2018-05-17 15:13  SsmDemo\.settings\.jsdtscope
     文件         430  2018-05-17 15:13  SsmDemo\.settings\org.eclipse.jdt.core.prefs
     文件          90  2018-05-17 15:13  SsmDemo\.settings\org.eclipse.m2e.core.prefs
     文件         746  2018-05-17 15:15  SsmDemo\.settings\org.eclipse.wst.common.component
     文件         252  2018-05-17 15:13  SsmDemo\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2018-05-17 15:13  SsmDemo\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2018-05-17 15:13  SsmDemo\.settings\org.eclipse.wst.jsdt.ui.superType.name
     文件          50  2018-05-17 15:13  SsmDemo\.settings\org.eclipse.wst.validation.prefs
     文件        3066  2018-05-22 15:07  SsmDemo\pom.xml
     目录           0  2018-05-17 15:15  SsmDemo\src\
     目录           0  2018-05-17 15:15  SsmDemo\src\main\
     目录           0  2018-05-22 16:26  SsmDemo\src\main\java\
     目录           0  2018-05-17 15:17  SsmDemo\src\main\java\com\
     目录           0  2018-05-17 15:21  SsmDemo\src\main\java\com\ssm\
     目录           0  2018-05-17 15:17  SsmDemo\src\main\java\com\ssm\controller\
     文件       13738  2018-05-23 15:17  SsmDemo\src\main\java\com\ssm\controller\UserController.java
     目录           0  2018-05-17 15:18  SsmDemo\src\main\java\com\ssm\mapper\
     文件         403  2018-05-17 15:29  SsmDemo\src\main\java\com\ssm\mapper\UserMapper.java
     文件        1433  2018-05-17 17:07  SsmDemo\src\main\java\com\ssm\mapper\UserMapper.xml
     目录           0  2018-05-17 15:19  SsmDemo\src\main\java\com\ssm\model\
     文件        1124  2018-05-17 15:27  SsmDemo\src\main\java\com\ssm\model\User.java
     目录           0  2018-05-17 15:21  SsmDemo\src\main\java\com\ssm\service\
     目录           0  2018-05-17 15:21  SsmDemo\src\main\java\com\ssm\service\impl\
     文件        1303  2018-05-17 16:08  SsmDemo\src\main\java\com\ssm\service\impl\UserServiceImpl.java
     文件         397  2018-05-21 11:11  SsmDemo\src\main\java\com\ssm\service\UserService.java
     目录           0  2018-05-22 16:27  SsmDemo\src\main\java\Excel\
     文件        2856  2018-05-23 15:36  SsmDemo\src\main\java\Excel\ExportExcel.java
............此处省略60个文件信息

评论

共有 条评论