Skip to content

Commit 07935dc

Browse files
committed
java
java项目
0 parents  commit 07935dc

File tree

265 files changed

+6242
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

265 files changed

+6242
-0
lines changed

Diff for: JspChat/.classpath

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk8">
5+
<attributes>
6+
<attribute name="owner.project.facets" value="java"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v7.0">
10+
<attributes>
11+
<attribute name="owner.project.facets" value="jst.web"/>
12+
</attributes>
13+
</classpathentry>
14+
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
15+
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
16+
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/jstl.jar"/>
17+
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/log4j-1.2.17.jar"/>
18+
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/mybatis-3.3.0.jar"/>
19+
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/ojdbc6.jar"/>
20+
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/standard.jar"/>
21+
<classpathentry kind="output" path="build/classes"/>
22+
</classpath>

Diff for: JspChat/.project

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>JspChat</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.jdt.core.javabuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.wst.common.project.facet.core.builder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
<buildCommand>
24+
<name>org.eclipse.wst.validation.validationbuilder</name>
25+
<arguments>
26+
</arguments>
27+
</buildCommand>
28+
</buildSpec>
29+
<natures>
30+
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
31+
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
32+
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
33+
<nature>org.eclipse.jdt.core.javanature</nature>
34+
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
35+
</natures>
36+
</projectDescription>

Diff for: JspChat/.settings/.jsdtscope

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="WebContent"/>
4+
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
5+
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
6+
<attributes>
7+
<attribute name="hide" value="true"/>
8+
</attributes>
9+
</classpathentry>
10+
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
11+
<classpathentry kind="output" path=""/>
12+
</classpath>

Diff for: JspChat/.settings/org.eclipse.jdt.core.prefs

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
4+
org.eclipse.jdt.core.compiler.compliance=1.8
5+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
6+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
7+
org.eclipse.jdt.core.compiler.source=1.8

Diff for: JspChat/.settings/org.eclipse.wst.common.component

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
2+
<wb-module deploy-name="JspChat">
3+
<wb-resource deploy-path="/" source-path="/WebContent" tag="defaultRootSource"/>
4+
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>
5+
<property name="context-root" value="JspChat"/>
6+
<property name="java-output-path" value="/JspChat/build/classes"/>
7+
</wb-module>
8+
</project-modules>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<faceted-project>
3+
<runtime name="Apache Tomcat v7.0"/>
4+
<fixed facet="wst.jsdt.web"/>
5+
<fixed facet="java"/>
6+
<fixed facet="jst.web"/>
7+
<installed facet="java" version="1.8"/>
8+
<installed facet="jst.web" version="3.0"/>
9+
<installed facet="wst.jsdt.web" version="1.0"/>
10+
</faceted-project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.eclipse.wst.jsdt.launching.baseBrowserLibrary
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Window

Diff for: JspChat/WebContent/Exit.jsp

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<%@ page language="java" contentType="text/html; charset=utf-8"
2+
pageEncoding="utf-8" import="java.util.*"%>
3+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
4+
<html>
5+
<head>
6+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
7+
<title>Insert title here</title>
8+
</head>
9+
<body>
10+
<%
11+
//取得登录的用户名
12+
String username = (String) session.getAttribute("user");
13+
//销毁session
14+
session.invalidate();
15+
// 从在线列表中删除用户名
16+
List onlineUserList = (List) application.getAttribute("onlineUserList");
17+
onlineUserList.remove(username);
18+
application.setAttribute("onlineUserList",onlineUserList);
19+
response.sendRedirect("login.jsp");
20+
%>
21+
22+
<!-- <script type="text/javascript">
23+
if(confim("你确定要退出系统吗"))
24+
{
25+
window.close();
26+
27+
}
28+
29+
</script> -->
30+
31+
</body>
32+
</html>

Diff for: JspChat/WebContent/META-INF/MANIFEST.MF

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Manifest-Version: 1.0
2+
Class-Path:
3+

Diff for: JspChat/WebContent/NewFile.jsp

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<html><head>
2+
<base href="http://localhost:8080/webqq/">
3+
<style type="text/css">
4+
5+
body {
6+
background-size: cover;
7+
color: #666666;
8+
font-family: "Helvetica Neue",Helvetica,"Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;
9+
height: 100%;
10+
}
11+
.a {
12+
background: #cf3 none repeat scroll 0 0;
13+
height: 100%;
14+
margin: 0 auto;
15+
width: 1000px;
16+
}
17+
.b {
18+
float: left;
19+
height: 80%;
20+
margin: 20px;
21+
width: 280px;
22+
}
23+
.c {
24+
float: left;
25+
height: 60%;
26+
margin: 20px;
27+
position: relative;
28+
width: 500px;
29+
}
30+
.d {
31+
float: left;
32+
margin-left: 20px;
33+
margin-right: 20px;
34+
margin-top: 20px;
35+
width: 500px;
36+
}
37+
</style>
38+
<title>JSP聊天室</title>
39+
<meta content="no-cache" http-equiv="pragma">
40+
<meta content="no-cache" http-equiv="cache-control">
41+
<meta content="0" http-equiv="expires">
42+
<meta content="keyword1,keyword2,keyword3" http-equiv="keywords">
43+
<meta content="This is my page" http-equiv="description">
44+
45+
<!-- <link rel="stylesheet" type="text/css" href="styles.css"> -->
46+
</head>
47+
<!-- <frameset rows="70%,30%"> -->
48+
<!-- <frameset cols="80%,20%"> -->
49+
<!-- <frame src="left.jsp" name="left" class="left"/> -->
50+
<!-- <frame src="right.jsp" name="right" class="right"/> -->
51+
<!-- </frameset> -->
52+
<!-- <frame src="bottom.jsp" class="bottom"/> -->
53+
<!-- </frameset> -->
54+
<body>
55+
<div class="a">
56+
<div class="b">
57+
<iframe name="right" src="right.jsp"></iframe>
58+
</div>
59+
<div class="c">
60+
<iframe name="left" src="left.jsp"></iframe>
61+
</div>
62+
<div class="d">
63+
<iframe src="bottom.jsp"></iframe>
64+
</div>
65+
</div>
66+
67+
68+
</body></html>

Diff for: JspChat/WebContent/Qqlogin.jsp

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<%@ page import="java.sql.*"%>
2+
<%@ page language="java" contentType="text/html; charset=UTF-8"
3+
pageEncoding="UTF-8"%>
4+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
5+
<html>
6+
<head>
7+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
8+
<title>正在登录..</title>
9+
</head>
10+
<body>
11+
<%
12+
Connection con=null;
13+
String JDriver="com.mysql.jdbc.Driver";
14+
String username="root";
15+
String userPasswd="123456";
16+
String dbname="qq";
17+
String conURL="jdbc:mysql://localhost:3306/"+dbname;
18+
try
19+
{
20+
Class.forName(JDriver).newInstance();
21+
con=DriverManager.getConnection(conURL,username,userPasswd);
22+
}catch(Exception e)
23+
{
24+
System.err.println(e.getMessage());
25+
}
26+
String s1=new String(request.getParameter("user").getBytes("ISO-8859-1"),"utf-8");
27+
String s2=new String(request.getParameter("password").getBytes("ISO-8859-1"),"utf-8");
28+
//System.out.println(s2);
29+
try
30+
{
31+
Statement stm=con.createStatement();
32+
ResultSet result=null;//=stm.executeQuery("select count(*) from register");
33+
String s11 = null;
34+
result=stm.executeQuery("SELECT password FROM register WHERE user='"+s1+"'");
35+
while(result.next())
36+
{
37+
s11=result.getString("password");
38+
}
39+
if (s2.equals(s11)) {
40+
int x;
41+
java.util.Random r=new java.util.Random();
42+
x=(r.nextInt() >>> 1) %10;
43+
session.setAttribute("user", s1);
44+
session.setAttribute("tx",Integer.toString(x));
45+
response.sendRedirect("main.jsp");
46+
}else{
47+
response.getWriter().write("<script>alert('用户名或密码输入错误!!')</script>");
48+
response.setHeader("Refresh","0;url=login.jsp");
49+
50+
}
51+
result.close();
52+
stm.close();
53+
con.close();
54+
} catch (SQLException e) {
55+
// TODO Auto-generated catch block
56+
response.getWriter().write("<script>alert('用户名错误!!')</script>");
57+
response.setHeader("Refresh","0;url=login.jsp");
58+
}
59+
%>
60+
</body>
61+
</html>

Diff for: JspChat/WebContent/WEB-INF/lib/jstl.jar

20.2 KB
Binary file not shown.

Diff for: JspChat/WebContent/WEB-INF/lib/log4j-1.2.17.jar

478 KB
Binary file not shown.

Diff for: JspChat/WebContent/WEB-INF/lib/mybatis-3.3.0.jar

1.35 MB
Binary file not shown.

Diff for: JspChat/WebContent/WEB-INF/lib/ojdbc6.jar

2.01 MB
Binary file not shown.

Diff for: JspChat/WebContent/WEB-INF/lib/standard.jar

384 KB
Binary file not shown.

Diff for: JspChat/WebContent/bottom.jsp

+118
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
2+
<%
3+
String path = request.getContextPath();
4+
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
5+
%>
6+
7+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
8+
<html>
9+
<head>
10+
<base href="<%=basePath%>">
11+
12+
<title>My JSP 'bottom.jsp' starting page</title>
13+
14+
<meta http-equiv="pragma" content="no-cache">
15+
<meta http-equiv="cache-control" content="no-cache">
16+
<meta http-equiv="expires" content="0">
17+
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
18+
<meta http-equiv="description" content="This is my page">
19+
<!--
20+
<link rel="stylesheet" type="text/css" href="styles.css">
21+
-->
22+
<script type="text/javascript">
23+
function aaa(){
24+
document.getElementById("small").style.zIndex=1;
25+
26+
}
27+
function small(){
28+
document.getElementById("small").style.zIndex=3;
29+
}
30+
function resetRadio()
31+
{
32+
for(i=0;i<5;i++)
33+
document.form1.radiobutton[i].checked=false
34+
35+
}
36+
function sendMsg() {
37+
if (formms.message.value == ""&&formms.touxiang.value=="") {
38+
alert("不能发送空消息!");
39+
return false;
40+
}
41+
formms.mess.value = formms.message.value;
42+
formms.message.value = "";
43+
44+
window.location.href=window.location.href;
45+
}
46+
47+
</script>
48+
<style type="text/css">
49+
body {
50+
font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB",
51+
"Microsoft YaHei", "微软雅黑", Arial, sans-serif;
52+
height: 100%;
53+
-webkit-background-size: cover;
54+
background-size: cover;
55+
color: #000;
56+
57+
position:relative;
58+
}
59+
60+
.login {
61+
padding: 2px 15px;
62+
font-size: 15px;
63+
color: rgb(0, 100, 233);
64+
-webkit-transition: background 250ms ease-in, color 250ms ease-in;
65+
border-radius: 6px;
66+
text-decoration: none;
67+
}
68+
69+
.login:hover {
70+
color: #fff;
71+
background: #BBD631;
72+
}
73+
74+
.doc {
75+
display: inline-block;
76+
}
77+
78+
.doc:hover {
79+
border: 1px;
80+
}
81+
#small{
82+
position:absolute;
83+
z-index:1;
84+
}
85+
#send{
86+
position:absolute;
87+
z-index:2;
88+
}
89+
90+
</style>
91+
</head>
92+
93+
<body>
94+
<form action="left.jsp" target="left" method="post" name="formms"
95+
onsubmit="return sendMsg()">
96+
字体颜色:<select name="textColor">
97+
<option value="black">黑色</option>
98+
<option value="red">红色</option>
99+
<option value="green">绿色</option>
100+
<option value="blue">蓝色</option>
101+
</select>
102+
&nbsp;&nbsp;文件管理:&nbsp;&nbsp;<a class="doc" href="document.jsp" target="_blank"><img
103+
alt="文件管理" title="文件上传下载" src="images/documentMessage.png"></a>
104+
&nbsp;&nbsp;选择表情:&nbsp;&nbsp;<img alt="表情"
105+
title="发送表情" src="images/small1.png" onclick="small()">
106+
<div id="small" name="small">
107+
<input type="radio" name="touxiang" value="images/f01.gif" onclick="aaa()"><img src="images/f01.gif">
108+
<input type="radio" name="touxiang" value="images/f02.gif" onclick="aaa()"><img src="images/f02.gif">
109+
<input type="radio" name="touxiang" value="images/f03.gif" onclick="aaa()"><img src="images/f03.gif">
110+
<input type="radio" name="touxiang" value="images/f04.gif" onclick="aaa()"><img src="images/f04.gif">
111+
</div>
112+
<div id="send"><input type="text" name="message"
113+
style="width: 300px; height: 30px;"> <input type="submit"
114+
value="发送" class="login"> <input type="hidden" name="mess">
115+
</div>
116+
</form>
117+
</body>
118+
</html>

0 commit comments

Comments
 (0)