资源简介
myeclipse开发 mysql数据库实现 javaEE项目
会议管理系统包括前台和后台,通过选择身份登录到前台或后台。
前台包括会议预约,会议室申请,设备申请等
后台包括预约查询,会议室查询,设备查询
代码片段和文件信息
package com.corp.mms.checkno.servlet;
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGImageEncoder;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.Random;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class CheckCodeServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
public static final char[] CHARS = { ‘1‘ ‘2‘ ‘3‘ ‘4‘ ‘5‘ ‘6‘ ‘7‘
‘8‘ ‘9‘ ‘0‘ ‘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‘ };
public static Random random = new Random();
public static String getRandomString() {
StringBuffer buffer = new StringBuffer();
for (int i = 0; i < 5; i++) {
buffer.append(CHARS[random.nextInt(CHARS.length)]);
}
return buffer.toString();
}
public static Color getRandomColor() {
return new Color(random.nextInt(255) random.nextInt(255) random
.nextInt(255));
}
public static Color getReverseColor(Color c) {
return new Color(255 - c.getRed() 255 - c.getGreen() 255 - c
.getBlue());
}
public void destroy() {
super.destroy();
}
public void doGet(HttpServletRequest request HttpServletResponse response)
throws ServletException IOException {
doPost(request response);
}
public void doPost(HttpServletRequest request HttpServletResponse response)
throws ServletException IOException {
response.setHeader(“Pragma“ “No-cache“);
response.setHeader(“Cache-Control“ “no-cache“);
response.setHeader(“Expires“ “0“);
response.setContentType(“image/jpeg“);
String radomString = getRandomString();
request.getSession().setAttribute(“checkCode“ radomString);
Color color = getRandomColor();
Color reverse = getReverseColor(color);
BufferedImage bi = new BufferedImage(100 30 1);
Graphics2D g = bi.createGraphics();
g.setFont(new Font(“SansSerif“ 1 22));
g.setColor(new Color(244 244 244));
g.fillRect(0 0 100 35);
g.setColor(reverse);
g.drawString(radomString 15 22);
int i = 0;
for (int n = random.nextInt(100); i < n; i++) {
g.drawRect(random.nextInt(100) random.nextInt(30) 1 1);
}
ServletOutputStream out = response.getOutputStream();
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
encoder.encode(bi);
out.flush();
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 621 2013-05-09 09:58 MeetingManageSys\.classpath
文件 321 2013-05-09 09:50 MeetingManageSys\.myme
文件 1422 2013-05-09 10:01 MeetingManageSys\.project
文件 500 2013-05-09 09:50 MeetingManageSys\.settings\.jsdtscope
文件 330 2013-05-09 09:50 MeetingManageSys\.settings\org.eclipse.jdt.core.prefs
文件 49 2013-05-09 09:50 MeetingManageSys\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2013-05-09 09:50 MeetingManageSys\.settings\org.eclipse.wst.jsdt.ui.superType.name
文件 13920 2013-04-09 10:25 MeetingManageSys\meetingmanagesys.sql
文件 2672 2013-05-09 10:10 MeetingManageSys\src\com\corp\mms\checkno\servlet\CheckCodeServlet.java
文件 9188 2013-03-23 10:02 MeetingManageSys\src\com\corp\mms\equip\dao\EquipDao.java
文件 1471 2013-03-23 00:33 MeetingManageSys\src\com\corp\mms\equip\service\EquipService.java
文件 2852 2013-05-04 12:10 MeetingManageSys\src\com\corp\mms\equip\servlet\AUEquipServlet.java
文件 3251 2013-05-04 12:11 MeetingManageSys\src\com\corp\mms\equip\servlet\EquipServlet.java
文件 1269 2013-03-22 17:15 MeetingManageSys\src\com\corp\mms\equip\vo\Equipment.java
文件 337 2013-03-23 00:28 MeetingManageSys\src\com\corp\mms\equip\vo\EquipType.java
文件 4502 2013-05-04 12:11 MeetingManageSys\src\com\corp\mms\home\dao\HomeDao.java
文件 710 2013-05-04 12:11 MeetingManageSys\src\com\corp\mms\home\service\HomeService.java
文件 2360 2013-05-04 12:12 MeetingManageSys\src\com\corp\mms\home\servlet\AUHomeServlet.java
文件 2217 2013-05-04 12:12 MeetingManageSys\src\com\corp\mms\home\servlet\HomeServlet.java
文件 1028 2013-03-23 14:37 MeetingManageSys\src\com\corp\mms\home\vo\Home.java
文件 25101 2013-03-29 15:00 MeetingManageSys\src\com\corp\mms\meeting\dao\MeetingDao.java
文件 3481 2013-05-04 12:13 MeetingManageSys\src\com\corp\mms\meeting\service\MeetingService.java
文件 3215 2013-05-09 09:59 MeetingManageSys\src\com\corp\mms\meeting\servlet\ApplicationQueryServlet.java
文件 2459 2013-05-04 12:14 MeetingManageSys\src\com\corp\mms\meeting\servlet\MeetingCheckServlet.java
文件 3332 2013-05-04 12:14 MeetingManageSys\src\com\corp\mms\meeting\servlet\MeetingQueryServlet.java
文件 11800 2013-05-09 09:53 MeetingManageSys\src\com\corp\mms\meeting\servlet\MeetingServlet.java
文件 2279 2013-05-04 12:27 MeetingManageSys\src\com\corp\mms\meeting\vo\Meeting.java
文件 1175 2013-05-04 12:28 MeetingManageSys\src\com\corp\mms\meeting\vo\MeetingTime.java
文件 869 2013-05-04 12:28 MeetingManageSys\src\com\corp\mms\meeting\vo\Schedule.java
文件 457 2013-03-18 14:45 MeetingManageSys\src\com\corp\mms\menu\vo\li
............此处省略229个文件信息
- 上一篇:android 五子棋源码
- 下一篇:家庭理财工具java实现
评论
共有 条评论