├── webJava
├── .settings
│ ├── org.eclipse.wst.jsdt.ui.superType.name
│ ├── org.eclipse.wst.jsdt.ui.superType.container
│ ├── org.eclipse.wst.ws.service.policy.prefs
│ ├── org.eclipse.wst.common.project.facet.core.xml
│ ├── org.eclipse.wst.common.component
│ ├── .jsdtscope
│ └── org.eclipse.jdt.core.prefs
├── WebContent
│ ├── META-INF
│ │ └── MANIFEST.MF
│ ├── css
│ │ ├── index.css
│ │ ├── xinxi.css
│ │ └── zhuce.css
│ ├── images
│ │ └── post2.jpg
│ ├── lib
│ │ └── mysql-connector-java-5.1.8.jar
│ ├── html
│ │ ├── index.html
│ │ ├── zhuce.jsp
│ │ ├── addEmp.jsp
│ │ ├── updateEmp.jsp
│ │ └── listEmp.jsp
│ ├── index.jsp
│ └── WEB-INF
│ │ └── web.xml
├── src
│ ├── com
│ │ └── tedu
│ │ │ ├── Test
│ │ │ ├── Test01.java
│ │ │ └── TestCase.java
│ │ │ ├── dao
│ │ │ ├── EmpDao.java
│ │ │ └── UserDao.java
│ │ │ ├── utils
│ │ │ ├── DBTools.java
│ │ │ └── UUIDUtil.java
│ │ │ ├── web
│ │ │ └── EmpServlet.java
│ │ │ └── entity
│ │ │ ├── Emp.java
│ │ │ └── userInfo.java
│ └── db.properties
├── build
│ └── classes
│ │ ├── com
│ │ └── tedu
│ │ │ ├── Test
│ │ │ ├── Test01.class
│ │ │ └── TestCase.class
│ │ │ ├── dao
│ │ │ ├── EmpDao.class
│ │ │ └── UserDao.class
│ │ │ ├── entity
│ │ │ ├── Emp.class
│ │ │ └── userInfo.class
│ │ │ ├── utils
│ │ │ ├── DBTools.class
│ │ │ └── UUIDUtil.class
│ │ │ └── web
│ │ │ └── EmpServlet.class
│ │ └── db.properties
├── WebRoot
│ └── WEB-INF
│ │ ├── classes
│ │ └── com
│ │ │ └── tedu
│ │ │ ├── Test
│ │ │ ├── Test01.class
│ │ │ └── TestCase.class
│ │ │ ├── dao
│ │ │ └── EmpDao.class
│ │ │ ├── entity
│ │ │ └── Emp.class
│ │ │ └── utils
│ │ │ └── DBTools.class
│ │ └── web.xml
├── db.properties
├── .mymetadata
├── (2).classpath
├── .classpath
└── .project
└── README.md
/webJava/.settings/org.eclipse.wst.jsdt.ui.superType.name:
--------------------------------------------------------------------------------
1 | Window
--------------------------------------------------------------------------------
/webJava/WebContent/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Class-Path:
3 |
4 |
--------------------------------------------------------------------------------
/webJava/.settings/org.eclipse.wst.jsdt.ui.superType.container:
--------------------------------------------------------------------------------
1 | org.eclipse.wst.jsdt.launching.baseBrowserLibrary
--------------------------------------------------------------------------------
/webJava/WebContent/css/index.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yehuimmd/javaWeb/HEAD/webJava/WebContent/css/index.css
--------------------------------------------------------------------------------
/webJava/WebContent/css/xinxi.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yehuimmd/javaWeb/HEAD/webJava/WebContent/css/xinxi.css
--------------------------------------------------------------------------------
/webJava/WebContent/css/zhuce.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yehuimmd/javaWeb/HEAD/webJava/WebContent/css/zhuce.css
--------------------------------------------------------------------------------
/webJava/WebContent/images/post2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yehuimmd/javaWeb/HEAD/webJava/WebContent/images/post2.jpg
--------------------------------------------------------------------------------
/webJava/src/com/tedu/Test/Test01.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yehuimmd/javaWeb/HEAD/webJava/src/com/tedu/Test/Test01.java
--------------------------------------------------------------------------------
/webJava/src/com/tedu/dao/EmpDao.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yehuimmd/javaWeb/HEAD/webJava/src/com/tedu/dao/EmpDao.java
--------------------------------------------------------------------------------
/webJava/src/com/tedu/Test/TestCase.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yehuimmd/javaWeb/HEAD/webJava/src/com/tedu/Test/TestCase.java
--------------------------------------------------------------------------------
/webJava/src/com/tedu/utils/DBTools.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yehuimmd/javaWeb/HEAD/webJava/src/com/tedu/utils/DBTools.java
--------------------------------------------------------------------------------
/webJava/src/com/tedu/web/EmpServlet.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yehuimmd/javaWeb/HEAD/webJava/src/com/tedu/web/EmpServlet.java
--------------------------------------------------------------------------------
/webJava/build/classes/com/tedu/Test/Test01.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yehuimmd/javaWeb/HEAD/webJava/build/classes/com/tedu/Test/Test01.class
--------------------------------------------------------------------------------
/webJava/build/classes/com/tedu/dao/EmpDao.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yehuimmd/javaWeb/HEAD/webJava/build/classes/com/tedu/dao/EmpDao.class
--------------------------------------------------------------------------------
/webJava/build/classes/com/tedu/dao/UserDao.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yehuimmd/javaWeb/HEAD/webJava/build/classes/com/tedu/dao/UserDao.class
--------------------------------------------------------------------------------
/webJava/build/classes/com/tedu/entity/Emp.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yehuimmd/javaWeb/HEAD/webJava/build/classes/com/tedu/entity/Emp.class
--------------------------------------------------------------------------------
/webJava/.settings/org.eclipse.wst.ws.service.policy.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.wst.ws.service.policy.projectEnabled=false
3 |
--------------------------------------------------------------------------------
/webJava/build/classes/com/tedu/Test/TestCase.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yehuimmd/javaWeb/HEAD/webJava/build/classes/com/tedu/Test/TestCase.class
--------------------------------------------------------------------------------
/webJava/build/classes/com/tedu/utils/DBTools.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yehuimmd/javaWeb/HEAD/webJava/build/classes/com/tedu/utils/DBTools.class
--------------------------------------------------------------------------------
/webJava/WebContent/lib/mysql-connector-java-5.1.8.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yehuimmd/javaWeb/HEAD/webJava/WebContent/lib/mysql-connector-java-5.1.8.jar
--------------------------------------------------------------------------------
/webJava/build/classes/com/tedu/entity/userInfo.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yehuimmd/javaWeb/HEAD/webJava/build/classes/com/tedu/entity/userInfo.class
--------------------------------------------------------------------------------
/webJava/build/classes/com/tedu/utils/UUIDUtil.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yehuimmd/javaWeb/HEAD/webJava/build/classes/com/tedu/utils/UUIDUtil.class
--------------------------------------------------------------------------------
/webJava/build/classes/com/tedu/web/EmpServlet.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yehuimmd/javaWeb/HEAD/webJava/build/classes/com/tedu/web/EmpServlet.class
--------------------------------------------------------------------------------
/webJava/WebRoot/WEB-INF/classes/com/tedu/Test/Test01.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yehuimmd/javaWeb/HEAD/webJava/WebRoot/WEB-INF/classes/com/tedu/Test/Test01.class
--------------------------------------------------------------------------------
/webJava/WebRoot/WEB-INF/classes/com/tedu/dao/EmpDao.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yehuimmd/javaWeb/HEAD/webJava/WebRoot/WEB-INF/classes/com/tedu/dao/EmpDao.class
--------------------------------------------------------------------------------
/webJava/WebRoot/WEB-INF/classes/com/tedu/entity/Emp.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yehuimmd/javaWeb/HEAD/webJava/WebRoot/WEB-INF/classes/com/tedu/entity/Emp.class
--------------------------------------------------------------------------------
/webJava/WebRoot/WEB-INF/classes/com/tedu/Test/TestCase.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yehuimmd/javaWeb/HEAD/webJava/WebRoot/WEB-INF/classes/com/tedu/Test/TestCase.class
--------------------------------------------------------------------------------
/webJava/WebRoot/WEB-INF/classes/com/tedu/utils/DBTools.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yehuimmd/javaWeb/HEAD/webJava/WebRoot/WEB-INF/classes/com/tedu/utils/DBTools.class
--------------------------------------------------------------------------------
/webJava/db.properties:
--------------------------------------------------------------------------------
1 | #??
2 | driverClass=com.mysql.jdbc.Driver
3 | url=jdbc\:mysql\://localhost\:3306/test?useUnicode\=true&charestEncoding\=utf-8
4 | user=root
5 | password=123456
6 |
7 |
--------------------------------------------------------------------------------
/webJava/src/db.properties:
--------------------------------------------------------------------------------
1 | #??
2 | driverClass=com.mysql.jdbc.Driver
3 | url=jdbc\:mysql\://localhost\:3306/test?useUnicode\=true&charestEncoding\=utf-8
4 | user=root
5 | password=123456
6 |
7 |
--------------------------------------------------------------------------------
/webJava/build/classes/db.properties:
--------------------------------------------------------------------------------
1 | #??
2 | driverClass=com.mysql.jdbc.Driver
3 | url=jdbc\:mysql\://localhost\:3306/test?useUnicode\=true&charestEncoding\=utf-8
4 | user=root
5 | password=123456
6 |
7 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # javaWeb
2 | javaWeb项目之简单的员工管理系统
3 |
4 | #### 项目说明
5 |
6 | 这是一个使用到Java及web前端相关技术的小项目,用到的技术有HTML、css、java、jsp,jdbc,用到的开发工具是myeclipse,数据库MySQL等。
7 |
8 | #### 实现的功能
9 |
10 | - 员工登录
11 | - 员工注册
12 | - 员工信息的录入
13 | - 员工信息的增删改查
14 |
--------------------------------------------------------------------------------
/webJava/.mymetadata:
--------------------------------------------------------------------------------
1 |
2 |
10 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/webJava/WebContent/index.jsp:
--------------------------------------------------------------------------------
1 | <%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
2 | <%
3 | String path = request.getContextPath();
4 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
5 | %>
6 |
7 |
8 |
9 |
10 | | ID | 92 |姓名 | 93 |年龄 | 94 |工资 | 95 |操作 | 96 |
| 没有数据 | 103 |||||
| <%=emp.getId() %> | 111 |<%=emp.getName() %> | 112 |<%=emp.getAge() %> | 113 |<%=emp.getSalary() %> | 114 |115 | 删除 117 | 修改 118 | |
8 | * UUID 辅助工具. 9 | * Description: 10 | * 11 | * Author: zhouguangyong@iyooc.cn 12 | * Date: 2014-01-01 上午10:00:01 13 | * Copyright: Copyright ©2006-2015 iyooc.cn Technology Co., Ltd. All rights reserved. 14 | * Changelog: 15 | * Ver Date Author Detail 16 | * ---------------------------------------------------------------------- 17 | * 1.0 2014-01-01 10:00:01 zhouguangyong@iyooc.cn 18 | * new file. 19 | *20 | */ 21 | public abstract class UUIDUtil { 22 | 23 | protected static final String IP; 24 | 25 | protected static final String JVM; 26 | 27 | protected static short COUNTER = (short) 0; 28 | 29 | protected static final Object _lock = new Object(); 30 | 31 | static { 32 | int ip; 33 | try { 34 | // System.out.println(InetAddress.getLocalHost().getHostAddress()); 35 | InetAddress ia = InetAddress.getLocalHost(); 36 | // String _ip = ia.getHostAddress(); 37 | ip = toInt(ia.getAddress()); 38 | } catch (Exception e) { 39 | ip = 0; 40 | } 41 | String _ip = Integer.toHexString(ip); 42 | StringBuffer sb = new StringBuffer("00000000"); 43 | sb.replace(8 - _ip.length(), 8, _ip); 44 | IP = sb.toString(); 45 | 46 | int jvm = (int) (System.currentTimeMillis() >>> 8); 47 | String _jvm = Integer.toHexString(jvm); 48 | StringBuffer jvmSb = new StringBuffer("00000000"); 49 | jvmSb.replace(8 - _jvm.length(), 8, _jvm); 50 | JVM = jvmSb.toString(); 51 | } 52 | 53 | /** 54 | * 受保护的构造方法, 防止外部构建对象实例. 55 | */ 56 | protected UUIDUtil() { 57 | super(); 58 | } 59 | 60 | /** 61 | * 二进制转换为Int值. 62 | * 63 | * @param bytes 64 | * @return int 65 | */ 66 | public static int toInt(byte[] bytes) { 67 | int result = 0; 68 | for (int i = 0; i < 4; i++) { 69 | result = (result << 8) - Byte.MIN_VALUE + (int) bytes[i]; 70 | } 71 | return result; 72 | } 73 | 74 | /** 75 | * Unique in a millisecond for this JVM instance (unless there are > 76 | * Short.MAX_VALUE instances created in a millisecond) 77 | */ 78 | protected static short getCount() { 79 | synchronized (_lock) { 80 | if (COUNTER < 0) { 81 | COUNTER = 0; 82 | } 83 | return COUNTER++; 84 | } 85 | } 86 | 87 | /** 88 | * 生成数据库记录PK(模拟Hibernate中的UUID策略). 89 | * 90 | * @return String 91 | */ 92 | public static String getUuid() { 93 | StringBuffer sb = new StringBuffer(36); 94 | sb.append(IP).append(JVM); 95 | 96 | short hitime = (short) (System.currentTimeMillis() >>> 32); 97 | String _hitime = Integer.toHexString(hitime); 98 | StringBuffer hitimeSb = new StringBuffer("0000"); 99 | hitimeSb.replace(4 - _hitime.length(), 4, _hitime); 100 | sb.append(hitimeSb); 101 | 102 | int lotime = (int) System.currentTimeMillis(); 103 | String _lotime = Integer.toHexString(lotime); 104 | StringBuffer lotimeSb = new StringBuffer("00000000"); 105 | lotimeSb.replace(8 - _lotime.length(), 8, _lotime); 106 | sb.append(lotimeSb); 107 | 108 | short count = getCount(); 109 | String _count = Integer.toHexString(count); 110 | StringBuffer countSb = new StringBuffer("0000"); 111 | countSb.replace(4 - _count.length(), 4, _count); 112 | sb.append(countSb); 113 | 114 | return sb.toString().toUpperCase(); 115 | } 116 | 117 | public static String getUuid32(){ 118 | return UUID.randomUUID().toString().replace("-", ""); 119 | } 120 | } 121 | --------------------------------------------------------------------------------