結課程式 ,望各位大神幫忙看看


相關代碼:
buy.jsp
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%request.setCharacterEncoding("UTF-8"); %>
<%
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="https://bbs.csdn.net/topics/">
<title>My JSP 'index.jsp' starting page</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="https://bbs.csdn.net/topics/styles.css">
-->
<jsp:useBean id="reg" scope="request" class="buy.BUYRegister"/>
</head>
<body>
<form action ="buycheck.jsp" method = "post">
<div class="login1">
<span class="login1_1"> <br> 購買 </span>
</div>
</div>
<div class="login2">
<span class="login2_1"> 書籍編號:</span>
<input type="text" name="bookid" value="https://bbs.csdn.net/topics/
</div>
<div class="login3">
<span class="login3_1"> 數量</span>
<input type="text" name="booknumber" value="https://bbs.csdn.net/topics/
</div>
<div class="login4">
<span class="login4_1">電話:</span>
<input type="text" name="useriphone" value="https://bbs.csdn.net/topics/
</div>
<div class="login4">
<span class="login4_1">地址:</span>
<input type="text" name="address" value="https://bbs.csdn.net/topics/
</div>
<div class="login4">
<span class="login4_1">用戶id:</span>
<input type="text" name="userid" value="https://bbs.csdn.net/topics/
</div>
</div>
<div class="login5">
<span class="login5_1"> </span>
<input type="submit" value="https://bbs.csdn.net/topics/購買"> <input type = "reset" value="https://bbs.csdn.net/topics/清空">
</div>
</form>
</body>
</html>
<style>
<style>
*{ font-size:50px; font-family:"宋體"; color:black;margin:0 auto;}
body{ margin:0; background-color:#66ccff;}
input{ border:none;}
.login1 {
width:1500px;
height:310px;
overflow:hidden;
text-align:center;
line-height: 120px;
letter-spacing:10px;
margin-bottom:2px;
}
.login1_1 {
font-size:110px;
font-weight:bold;
color:#FFFFFF;
}
.login2 {
background:#66ccff;
width:px;
height:80px;
overflow:hidden;
text-align:center;
line-height: 50px;
margin-bottom:1px;
}
.login2_1 {
font-size:40px;
font-weight:bold;
color:#FFFFFF;
}
.login3 {
background:#66ccff;
width:px;
height:80px;
overflow:hidden;
text-align:center;
line-height: 50px;
margin-bottom:1px;
}
.login3_1 {
font-size:40px;
font-weight:bold;
color:#FFFFFF;
}
.login4 {
background:#66ccff;
width:px;
height:80px;
overflow:hidden;
text-align:center;
line-height: 50px;
margin-bottom:1px;
}
.login4_1 {
font-size:40px;
font-weight:bold;
color:#FFFFFF;
}
.login5 {
background:#66ccff;
width:px;
height:40px;
overflow:hidden;
text-align:center;
line-height: 50px;
margin-bottom:1px;
}
.login5_1 {
font-size:20px;
font-weight:bold;
color:#FFFFFF;
}
</style>
buycheck.jsp
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%request.setCharacterEncoding("UTF-8"); %>
<%
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="https://bbs.csdn.net/topics/">
<title>My JSP 'Check.jsp' starting page</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="https://bbs.csdn.net/topics/styles.css">
-->
<jsp:useBean id="reg" scope="request" class="buy.BUYRegister"/>
<jsp:useBean id="regi" scope="request" class="buy.BUYRegisterDB"/>
<jsp:setProperty name="reg" property="*"/>
</head>
<body>
<%
if(reg.invalidate()){
regi.register(reg);
%>
<jsp:forward page = "scuess.jsp"/>
<%
}else{
%>
<jsp:forward page = "buy.jsp"/>
<%} %>
This is my JSP page. <br>
</body>
</html>
scuess.jsp
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%request.setCharacterEncoding("UTF-8"); %>
<%
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="https://bbs.csdn.net/topics/">
<title>My JSP 'Sucess.jsp' starting page</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="https://bbs.csdn.net/topics/styles.css">
-->
<jsp:useBean id="reg" scope="request" class="buy.BUYRegister"/>
</head>
<body>
<div class="login1">
<span class="login1_1"> <br>訂單明細如下:</span>
</div>
<div class="login2">
<span class="login2_1"> 書籍id:</span>
<jsp:getProperty name="reg" property="bookid"/><br>
</div>
<div class="login2">
<span class="login2_1"> 數量</span>
<jsp:getProperty name="reg" property="booknumber"/><br>
</div>
<div class="login2">
<span class="login2_1"> 電話:</span>
<jsp:getProperty name="reg" property="useriphone"/><br>
</div>
<div class="login2">
<span class="login2_1"> 地址:</span>
<jsp:getProperty name="reg" property="address"/><br>
</div>
<div class="login2">
<span class="login2_1"> 用戶id:</span>
<jsp:getProperty name="reg" property="userid"/><br>
</div>
<div class="login2">
<span class="login2_1"> <a href="http://localhost:8080/a/buy.jsp">如訂單資訊錯誤可點擊重回購買界面</a></span><br>
<span class="login2_1"> <a href="http://localhost:8080/a/buy.jsp">如無誤可點擊重回主界面</a></span>
</div>
</body>
</html>
<style>
*{ font-size:50px; font-family:"宋體"; color:black;margin:0 auto;}
body{ margin:0; background-color:#66ccff;}
input{ border:none;}
.login1 {
width:1000px;
height:210px;
overflow:hidden;
text-align:center;
line-height: 120px;
letter-spacing:10px;
margin-bottom:2px;
}
.login1_1 {
font-size:100px;
font-weight:bold;
color:#FFFFFF;
}
.login2 {
background:#66ccff;
width:px;
height:100px;
overflow:hidden;
text-align:center;
line-height: 50px;
margin-bottom:1px;
}
.login2_1 {
font-size:20px;
font-weight:bold;
color:#FFFFFF;
}
</style>
uj5u.com熱心網友回復:
你有些是gbk有些是utf8,你統一吧gbk改成utf8就好了轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/64720.html
標籤:Eclipse
