master
dida 5 years ago
commit 7841d0516a

249
1.jsp

@ -0,0 +1,249 @@
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>登录|注册</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<script src="js/jquery-1.11.3.js"></script>
<style>
*{
-moz-user-select: none; /*火狐*/
-webkit-user-select: none; /*webkit浏览器*/
-ms-user-select: none; /*IE10*/
-khtml-user-select: none; /*早期浏览器*/
user-select: none;
}
#back{
background-image:url('./img/login2.png');
background-repeat: no-repeat,no-repeat;
background-size:contain,contain;
background-position: bottom;
height:93%;
width:100%;
}
.loginform{
position: relative;
width:350px;
margin-top: 8%;
margin-left: 15%
}
.loginform .logtype{
text-align: center;
margin-bottom: 30px;
letter-spacing: 1px;
}
.loginform .logtype a{
margin-right: 10px;
font-weight: bold;
font-size: 23px;
cursor: pointer;
}
.loginform .logtype a:ACTIVE{
color:#EEAD0E;
}
form{
}
form .info{
margin-bottom: 20px;
width:100%;
height:43px;
border-radius:7px;
background: rgb(235 ,235, 235);
border: none;
text-indent: 15px;
letter-spacing: 1px;
font-size: 95%;
outline-color: #FFB90F;
}
form .info:FOCUS{
background: white;
}
input::-moz-placeholder { /* Mozilla Firefox 4 to 18 适配火狐 */
color: rgb(180 ,180, 180);;
}
input::-webkit-input-placeholder { /* WebKit browsers 适配谷歌 */
color: rgb(180 ,180, 180);
}
.sub{
width:40%;
height:35px;
border-radius:7px;
border: none;
background: #FFB90F;
color: white;
font-size:120%;
letter-spacing: 4px;
display: inline;
vertical-align: top;
margin-top: 20px;
outline: none;
}
.sub:ACTIVE{
background: #EEAD0E;
}
.reg{
display: inline-block;
vertical-align: top;
margin-left: 40%;
text-align: right;
margin-top: 20px;
}
.reg p{
font-size: 80%;
color: rgb(180 ,180, 180);
margin-top: 0px;
margin-bottom: 5px;
cursor: pointer;
}
.reg p:ACTIVE {
color: #EEAD0E;
}
</style>
<style>/*导航*/
.newheader{
height: 60px;
background-color: #3CB371;
}
.head-nav{
height: 60px;
color: yellow;
position:relative;
left:-20px;
}
.head-nav #header-nav{
height: 60px;
color: yellow;
margin-top:0;
}
.logo{
}
.logo img{
height: 40px;
width: 40px;
float: left;
margin: auto 20px;
position:relative;
top:-10px;
}
.pr{
float: left;
margin: auto 10px;
}
.pr a{
color: white;
text-decoration: none;
position:relative;
top:20px;
}
.login{
height:60px;
}
</style>
<div class="newheader">
<div class="head-nav pr" id="head-navpre1">
<ul id="header-nav">
<a class="logo">
<img alt="" src="./img/sLogo.png" >
</a>
<li class="pr" style="display: block;">
<a href="/paths" >跳蚤市场</a>
</li>
<li class="pr" style="display: block;">
<a href="/courses" >校园超市</a>
</li>
<li class="pr" style="display: block;">
<a href="/shixuns">失物招领</a>
</li>
<li class="pr" style="display: block;">
<a href="/competitions">资源共享</a>
</li>
<li class="pr" style="display: block;">
<a href="/moop_cases">兴趣论坛</a>
</li>
</ul>
</div>
<span class="login pr" style="float: right;">
<a href="" class="mr5 color-white" >登录</a>
<em class="vertical-line" ></em>
<a href="/register" class="mr5 color-white">注册</a>
</span>
</div>
<div id="back" >
<div class="loginform">
<div class="logtype">
<a>登录</a>|
<a>注册</a>
</div>
<s:form action="Login" method="post" autocomplete="on">
<s:textfield name="user.username" cssClass="info" /><br/>
<s:password name="user.password" cssClass="info" placeholder="请输入密码" /><br/>
<input type="submit" class="sub" value="登录">
<div class="reg">
<p>注册</p>
<p>忘记密码</p>
</div>
</s:form>
<p style="text-align: center;font-family:cursive;">———其他登录方式 ———</p>
</div>
<div>
<script type="text/javascript">
var h=document.getElementById("back").clientHeight;
var w=document.getElementById("back").clientWidth;
if(h==null) console.log(0);
console.log(h);
console.log(w);
</script>
</body>
</html>

@ -0,0 +1,3 @@
Manifest-Version: 1.0
Class-Path:

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!--
Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping>
<class name="com.Userinfo" table="userinfo" catalog="postgres">
<id name="id" type="java.lang.Integer">
<column name="id" />
<generator class="identity" />
</id>
<property name="username" type="java.lang.String">
<column name="username" length="45" />
</property>
<property name="password" type="java.lang.String">
<column name="password" length="45" not-null="true" />
</property>
<property name="age" type="java.lang.Integer">
<column name="age" />
</property>
<property name="email" type="java.lang.String">
<column name="email" length="45" unique="true" />
</property>
</class>
</hibernate-mapping>

@ -0,0 +1,28 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<!-- Generated by MyEclipse Hibernate Tools. -->
<hibernate-configuration>
<session-factory>
<property name="dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="connection.url">
jdbc:mysql://localhost:3306/postgres
</property>
<property name="connection.username">root</property>
<property name="connection.password">3141592653</property>
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="myeclipse.connection.profile">
postgres
</property>
<mapping resource="com/Userinfo.hbm.xml" />
</session-factory>
</hibernate-configuration>

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<constant name="struts.devMode" value="false" />
<package name="basicstruts2" extends="struts-default">
<action name="registerInput">
<result>/register.jsp</result></action>
<action name="loginInput">
<result>/login.jsp</result></action>
<action name="Register" class="RegisterAction" method="register">
<result name="success">/success.jsp</result>
<result name="error">/error.jsp</result></action>
<action name="Login" class="RegisterAction" method="login">
<result name="success">/welcome.jsp</result>
<result name="error">/success.jsp</result></action>
</package>
</struts>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name></display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping></web-app>

@ -0,0 +1,18 @@
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Hello World</title>
</head>
<body>
<h1>Hello World From Struts2</h1>
<form action="hello">
<label for="name">Please enter your name</label><br/>
<input type="text" name="name"/>
<input type="submit" value="Say Hello"/>
</form>
</body>
</html>

@ -0,0 +1,16 @@
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head><title>登录页面</title></head>
<body>
<p>请输入用户名和密码</p>
<s:form action="Login">
<s:textfield name="user.username" label="用户名"
tooltip="输入用户名" labelposition="left" />
<s:password name="user.password" label="密码"
tooltip="输入密码" labelposition="left" />
<s:submit value="登录" align="center" />
</s:form>
</body></html>

@ -0,0 +1,18 @@
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head><title>用户注册</title></head>
<body>
<p>注册一个新用户</p>
<s:form action="Register">
<s:actionerror /><s:fielderror />
<s:textfield name="user.username" label="用户名" />
<s:password name="user.password" label="口令" />
<s:textfield name="user.age" label="年龄" />
<s:textfield name="user.email" label="Email地址" />
<s:submit value="登录" />
</s:form>
</body></html>

@ -0,0 +1,9 @@
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head><title>注册成功页面</title></head>
<body>
<p>注册成功</p>
<s:property value="user" />
<p><a href="<s:url action='index' />" >返回首页</a></p>
</body></html>

@ -0,0 +1,7 @@
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<html>
<head><title>登陆成功</title></head>
<body>
<p align="center"><font color="#000080" size="5">欢迎登陆本系统</font></p>
</body></html>
Loading…
Cancel
Save