资源简介
一个成型的旅游管理系统。包含后台数据库文件。可以直接使用,也可以作为学习参考!

代码片段和文件信息
package org.travel.contr;
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.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
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.*;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.Random;
@Controller
public class CaptchaController {
private int width = 80;// 定义图片的width
private int height = 20;// 定义图片的height
private int codeCount = 4;// 定义图片上显示验证码的个数
private int xx = 15;
private int fontHeight = 20;
private int codeY = 18;
char[] codeSequence = {‘A‘ ‘B‘ ‘C‘ ‘D‘ ‘E‘ ‘F‘ ‘G‘ ‘H‘ ‘I‘ ‘J‘ ‘K‘ ‘L‘ ‘M‘ ‘N‘ ‘O‘ ‘P‘ ‘Q‘ ‘R‘ ‘S‘ ‘T‘ ‘U‘ ‘V‘ ‘W‘ ‘X‘
‘Y‘ ‘Z‘ ‘0‘ ‘1‘ ‘2‘ ‘3‘ ‘4‘ ‘5‘ ‘6‘ ‘7‘ ‘8‘ ‘9‘};
/**
*
* @param timestamp
* @param code
* @param request
* @return true或fasleture表示验证成功false表示验证失败
*/
@RequestMapping(value = “/checkCaptcha.do“ method = RequestMethod.POST)
@ResponseBody
public String checkCaptcha(@RequestParam(value = “timestamp“ required = false) String timestamp @RequestParam(value = “code“ required = false) String code HttpServletRequest request) {
if(code == null || code.isEmpty()){
return “false“;
}
String original =(String) request.getSession().getAttribute(“code“);
if(original.equalsIgnoreCase(code)){
return “true“;
}
return “false“;
}
@RequestMapping(“/code.do“)
public void getCode(HttpServletRequest req HttpServletResponse resp) throws IOException {
// 定义图像buffer
BufferedImage buffImg = new BufferedImage(width height BufferedImage.TYPE_INT_RGB);
Graphics gd = buffImg.getGraphics();
// 创建一个随机数生成器类
Random random = new Random();
// 将图像填充为白色
gd.setColor(Color.WHITE);
gd.fillRect(0 0 width height);
// 创建字体,字体的大小应该根据图片的高度来定。
Font font = new Font(“Fixedsys“ Font.BOLD fontHeight);
// 设置字体。
gd.setFont(font);
// 画边框。
gd.setColor(Color.BLACK);
gd.drawRect(0 0 width - 1 height - 1);
// 随机产生40条干扰线,使图象中的认证码不易被其它程序探测到。
gd.setColor(Color.BLACK);
for (int i = 0; i < 10; i++) {
int x = random.nextInt(width);
int y = random.nextInt(height);
int xl = ran
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-01-10 21:51 TravelShowSystem\
文件 903 2019-01-10 21:38 TravelShowSystem\.classpath
文件 1450 2019-01-10 21:37 TravelShowSystem\.project
目录 0 2019-01-10 21:32 TravelShowSystem\.settings\
文件 564 2019-01-10 21:37 TravelShowSystem\.settings\.jsdtscope
文件 77 2019-01-10 21:32 TravelShowSystem\.settings\org.eclipse.core.resources.prefs
文件 478 2019-01-10 21:37 TravelShowSystem\.settings\org.eclipse.jdt.core.prefs
文件 90 2019-01-10 21:37 TravelShowSystem\.settings\org.eclipse.m2e.core.prefs
文件 702 2019-01-10 21:37 TravelShowSystem\.settings\org.eclipse.wst.common.component
文件 558 2019-01-10 21:37 TravelShowSystem\.settings\org.eclipse.wst.common.project.facet.core.prefs.xm
文件 545 2019-01-10 21:37 TravelShowSystem\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 51 2019-01-10 21:37 TravelShowSystem\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 8 2019-01-10 21:37 TravelShowSystem\.settings\org.eclipse.wst.jsdt.ui.superType.name
文件 50 2019-01-10 21:37 TravelShowSystem\.settings\org.eclipse.wst.validation.prefs
目录 0 2018-12-30 11:45 TravelShowSystem\WebRoot\
目录 0 2019-01-10 21:32 TravelShowSystem\WebRoot\WEB-INF\
目录 0 2019-01-10 21:39 TravelShowSystem\WebRoot\WEB-INF\classes\
目录 0 2019-01-10 21:39 TravelShowSystem\WebRoot\WEB-INF\classes\me
文件 111 2019-01-10 21:39 TravelShowSystem\WebRoot\WEB-INF\classes\me
目录 0 2019-01-10 21:39 TravelShowSystem\WebRoot\WEB-INF\classes\me
目录 0 2019-01-10 21:39 TravelShowSystem\WebRoot\WEB-INF\classes\me
目录 0 2019-01-10 21:39 TravelShowSystem\WebRoot\WEB-INF\classes\me
文件 256 2019-01-10 21:39 TravelShowSystem\WebRoot\WEB-INF\classes\me
文件 4490 2019-01-10 21:39 TravelShowSystem\WebRoot\WEB-INF\classes\me
文件 40 2019-01-10 21:39 TravelShowSystem\WebRoot\WEB-INF\classes\empty.xm
文件 1583 2019-01-10 21:39 TravelShowSystem\WebRoot\WEB-INF\classes\myBatisConfig.xm
目录 0 2019-01-10 21:39 TravelShowSystem\WebRoot\WEB-INF\classes\org\
目录 0 2019-01-10 21:43 TravelShowSystem\WebRoot\WEB-INF\classes\org\travel\
目录 0 2019-01-10 21:43 TravelShowSystem\WebRoot\WEB-INF\classes\org\travel\contr\
文件 4876 2019-01-10 21:43 TravelShowSystem\WebRoot\WEB-INF\classes\org\travel\contr\CaptchaController.class
文件 3175 2019-01-10 21:43 TravelShowSystem\WebRoot\WEB-INF\classes\org\travel\contr\DetailController.class
............此处省略619个文件信息
相关资源
- MoNyog8.5+破解补丁
- 全国4级地址库,京东数据
- 基于MVC模式的会员管理系统
- 简单的房屋租赁系统
- .net网站服装销售系统(MVC)
- 基于MVC模式的校园BBS系统的设计与实
- MVC模式编写的音乐网站
- MVC模式实现的计算器
- 扫雷(MVC架构)
- php程序实现数据库的增删改查
- 302 Found
- 关于Spring MVC项目maven中通过fileupload上
- 基于web的图书馆运营系统
- Navicat 完整版 (Mac 破解版,亲试成功
- 新闻管理系统前台和后台
- MVC做的小说管理系统
- 一个spring项目
- 数据库大量数据导出Excel
- .net mvc3完整案例
- springmvc+mybatis点餐系统(包含完整数据
- springMVC的学习代码
- Shopping+在线购物商城的实现Spring+Spr
- 基于MVC的网上书城系统
- springmvc+Mybatis+axis2+webservice+quartz作业整
- springmvc 实体层自动生成工具
- .net MVC+Bootstrap下使用localResizeIMG上传图
- .NET MVC实现文件上传
- Spring MVC 学习指南(第2版高清中文
- springmvc_2020.rar
- 基于SSM的校社联社团管理系统SpringM
评论
共有 条评论