• 大小: 44.04MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-08-07
  • 语言: 数据库
  • 标签: idea  ssm  java  

资源简介

基于ssm的医院挂号系统,idea开发,数据库为mysql,都在里面,访问地址为http://localhost:8080/index。

资源截图

代码片段和文件信息

package com.edu.swu.controller;

import com.google.code.kaptcha.Constants;
import com.google.code.kaptcha.Producer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.imageio.ImageIO;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.awt.image.BufferedImage;

/**
 * @Description //TODO:
 * @Author shaohjz
 * @Date 2019/2/25
 **/
@Controller
@RequestMapping(value = “/captcha“)
public class captchaController {
    /**
     * 验证码相关的接口
     *
     * @author gaowei.cheng
     */

    private static Logger log = LoggerFactory.getLogger(captchaController.class);

    @Autowired
    private Producer captchaProducer;

    @RequestMapping(value = “/getCaptchaImage“)
    public ModelAndView getCaptchaImage(HttpServletRequest request HttpServletResponse response) throws Exception {
        HttpSession session = request.getSession();
        String code = (String) session.getAttribute(Constants.KAPTCHA_SESSION_KEY);
        System.out.println(“******************验证码是: “ + code + “******************“);

        response.setDateHeader(“Expires“ 0);

        // Set standard HTTP/1.1 no-cache headers.
        response.setHeader(“Cache-Control“ “no-store no-cache must-revalidate“);

        // Set IE extended HTTP/1.1 no-cache headers (use addHeader).
        response.addHeader(“Cache-Control“ “post-check=0 pre-check=0“);

        // Set standard HTTP/1.0 no-cache header.
        response.setHeader(“Pragma“ “no-cache“);

        // return a jpeg
        response.setContentType(“image/jpeg“);

        // create the text for the image
        String capText = captchaProducer.createText();

        // store the text in the session
        session.setAttribute(Constants.KAPTCHA_SESSION_KEY capText);

        // create the image with the text
        BufferedImage bi = captchaProducer.createImage(capText);
        ServletOutputStream out = response.getOutputStream();

        // write the data out
        ImageIO.write(bi “jpg“ out);
        try {
            out.flush();
        } finally {
            out.close();
        }
        return null;
    }

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2020-03-09 15:26  IdeaProjects\
     目录           0  2020-03-08 14:42  IdeaProjects\.git\
     文件         130  2019-09-21 15:34  IdeaProjects\.git\config
     文件          73  2019-09-21 15:34  IdeaProjects\.git\description
     文件          23  2019-09-21 15:34  IdeaProjects\.git\HEAD
     目录           0  2020-03-07 22:27  IdeaProjects\.git\hooks\
     文件         478  2019-09-21 15:34  IdeaProjects\.git\hooks\applypatch-msg.sample
     文件         896  2019-09-21 15:34  IdeaProjects\.git\hooks\commit-msg.sample
     文件        3327  2019-09-21 15:34  IdeaProjects\.git\hooks\fsmonitor-watchman.sample
     文件         189  2019-09-21 15:34  IdeaProjects\.git\hooks\post-update.sample
     文件         424  2019-09-21 15:34  IdeaProjects\.git\hooks\pre-applypatch.sample
     文件        1638  2019-09-21 15:34  IdeaProjects\.git\hooks\pre-commit.sample
     文件        1348  2019-09-21 15:34  IdeaProjects\.git\hooks\pre-push.sample
     文件        4898  2019-09-21 15:34  IdeaProjects\.git\hooks\pre-rebase.sample
     文件         544  2019-09-21 15:34  IdeaProjects\.git\hooks\pre-receive.sample
     文件        1492  2019-09-21 15:34  IdeaProjects\.git\hooks\prepare-commit-msg.sample
     文件        3610  2019-09-21 15:34  IdeaProjects\.git\hooks\update.sample
     目录           0  2019-09-23 21:06  IdeaProjects\.git\info\
     目录           0  2020-03-07 22:27  IdeaProjects\.git\objects\
     目录           0  2019-09-23 21:06  IdeaProjects\.git\objects\info\
     目录           0  2019-09-23 21:06  IdeaProjects\.git\objects\pack\
     目录           0  2020-03-07 22:27  IdeaProjects\.git\refs\
     目录           0  2019-09-23 21:06  IdeaProjects\.git\refs\heads\
     目录           0  2019-09-23 21:06  IdeaProjects\.git\refs\tags\
     目录           0  2020-03-08 15:04  IdeaProjects\.idea\
     文件           8  2020-03-06 17:09  IdeaProjects\.idea\.name
     文件         541  2020-03-08 14:33  IdeaProjects\.idea\compiler.xml
     文件         177  2020-03-06 17:18  IdeaProjects\.idea\encodings.xml
     文件         656  2020-03-06 17:18  IdeaProjects\.idea\misc.xml
     文件         172  2020-03-06 17:18  IdeaProjects\.idea\vcs.xml
     文件       33314  2020-03-08 15:04  IdeaProjects\.idea\workspace.xml
............此处省略601个文件信息

评论

共有 条评论