欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

java注冊jsp代碼,jsp登錄注冊代碼

java 我做了簡單的用戶注冊系統(tǒng),現(xiàn)在我要把用戶注冊的信息顯示在jsp頁面上,該怎么寫?

//這句是用response跳轉(zhuǎn)到你要跳轉(zhuǎn)的頁面,并將值usename傳遞過去,

創(chuàng)新互聯(lián)建站專業(yè)為企業(yè)提供江安網(wǎng)站建設(shè)、江安做網(wǎng)站、江安網(wǎng)站設(shè)計、江安網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計與制作、江安企業(yè)網(wǎng)站模板建站服務(wù),十載江安做網(wǎng)站經(jīng)驗,不只是建網(wǎng)站,更提供有價值的思路和整體網(wǎng)絡(luò)服務(wù)。

response.sendRedirect("你要跳轉(zhuǎn)的頁面.jsp?usename="+usename);

//在你要跳轉(zhuǎn)的頁面,就用request獲取就行了。

h1%=request.getParameter("usename")%!歡迎你的登陸!/h1

具體的話,應(yīng)該是這么寫,其實也還有其他的方法,我就只記得這一個了,希望能幫到你

java 設(shè)計注冊用戶個人信息的JSP頁面

%@ page language="java" import="java.util.*" pageEncoding="gbk"%

%

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"

--

link href="../css/rayx.css" type="text/css" rel="stylesheet"

title填寫注冊信息/title

script language="javascript"

!--

function selectCity(){

if(RegInfoPost.state.value=="上海"){

RegInfoPost.city.value="上海";

}

else if(RegInfoPost.state.value=="天津"){

RegInfoPost.city.value="天津";

}

else if(RegInfoPost.state.value=="北京"){

RegInfoPost.city.value="北京";

}

else if(RegInfoPost.state.value=="重慶"){

RegInfoPost.city.value="重慶";

}

else if(RegInfoPost.state.value=="中國香港"){

RegInfoPost.city.value="中國香港";

}

else if(RegInfoPost.state.value=="中國澳門"){

RegInfoPost.city.value="中國澳門";

}

else{

RegInfoPost.city.value="";

}

}

function checkCity(){

if(RegInfoPost.city.value=="北京"){

RegInfoPost.address.focus();

}

if(RegInfoPost.city.value=="上海"){

RegInfoPost.address.focus();

}

if(RegInfoPost.city.value=="天津"){

RegInfoPost.address.focus();

}

if(RegInfoPost.city.value=="重慶"){

RegInfoPost.address.focus();

}

if(RegInfoPost.city.value=="中國香港"){

RegInfoPost.address.focus();

}

if(RegInfoPost.city.value=="中國澳門"){

RegInfoPost.address.focus();

}

}

--

/script

script language="javascript"

!--

function onSubmit(){

%//檢查姓名%

if(RegInfoPost.realName.value==""){

alert("請?zhí)顚懶彰?);

RegInfoPost.realName.focus();

return false;

}

%//檢查身份證%

else if(RegInfoPost.identityCard.value==""){

alert("請?zhí)顚懮矸葑C號碼!");

RegInfoPost.identityCard.focus();

return false;

}

%//檢查身份證的格式是否合法%

else if(chkid(RegInfoPost.identityCard.value)==0){

alert("您填寫的身份證號碼不是合法的身份證號碼!");

RegInfoPost.identityCard.focus();

return false;

}

%//檢查郵政編碼%

else if(RegInfoPost.zip.value==""){

alert("請?zhí)顚戉]政編碼!");

RegInfoPost.zip.focus();

return false;

}

%//檢查郵政編碼是否含有空格%

else if(chkspc(RegInfoPost.zip.value)!=1){

alert("郵政編碼含有空格!");

RegInfoPost.zip.focus();

return false;

}

%//檢查郵政編碼是否符合格式%

else if(checkZip(RegInfoPost.zip.value)==0){

alert("不是中國的郵政編碼,或者郵政編碼有非法字符!");

RegInfoPost.zip.focus();

return false;

}

%//檢查省市自治區(qū)%

else if(RegInfoPost.state.value=="default"){

alert("請選擇省市自治區(qū)!");

RegInfoPost.state.focus();

return false;

}

%//檢查城市%

else if(RegInfoPost.city.value==""){

alert("請?zhí)顚懗鞘校?);

RegInfoPost.city.focus();

return false;

}

%//檢查地址%

else if(RegInfoPost.address.value==""){

alert("請?zhí)顚懙刂罚?);

RegInfoPost.address.focus();

return false;

}

%//檢查主要聯(lián)系電話%

else if(RegInfoPost.phone.value==""){

alert("請?zhí)顚懼饕?lián)系電話!");

RegInfoPost.phone.focus();

return false;

}

%//檢查生日(年)%

else if(RegInfoPost.birthdayYear.value==""){

alert("請?zhí)顚懩纳眨?);

RegInfoPost.birthdayYear.focus();

return false;

}

%//檢查出生年份有效性%

else if(chkYear(RegInfoPost.birthdayYear.value)==0){

alert("您的生日不符合格式!");

RegInfoPost.birthdayYear.focus();

return false;

}

%//檢查生日(月)%

else if(RegInfoPost.birthdayMonth.value=="default"){

alert("請?zhí)顚懩纳眨?);

RegInfoPost.birthdayMonth.focus();

return false;

}

%//檢查生日(日)%

else if(RegInfoPost.birthdayDay.value=="default"){

alert("請?zhí)顚懩纳眨?);

RegInfoPost.birthdayDay.focus();

return false;

}

%//檢查電子郵件%

else if(RegInfoPost.email.value==""){

alert("請?zhí)顚懩碾娮余]件地址!");

RegInfoPost.email.focus();

return false;

}

%//檢查電子郵件是否合法%

else if(chkemail(RegInfoPost.email.value)!=1){

alert("電子郵件地址不符合格式!");

RegInfoPost.email.focus();

return false;

}

%//檢查用于確認(rèn)的電子郵件地址%

else if(RegInfoPost.email.value!=RegInfoPost.email2.value){

alert("請確認(rèn)您的電子郵件填寫的準(zhǔn)確無誤!");

RegInfoPost.email2.focus();

return false;

}

else{

%

session.setAttribute("frompage","reg.jsp");

%

RegInfoPost.submit();

}

}

%

//函數(shù)名:chkspc

//功能介紹:檢查是否含有空格

//參數(shù)說明:要檢查的字符串

//返回值:0:有空格 1:沒有空格 2:有空格

%

function chkspc(a){

var i=a.length;

var j = 0;

var k = 0;

while(ki){

if(a.charAt(k)!=" "){

j = j+1;

}

k = k+1;

}

if(j==0){

return 0;

}

if(i!=j){

return 2;

}

else{

return 1;

}

}

%

//函數(shù)名:checkNum

//功能介紹:檢查是否為數(shù)字

//參數(shù)說明:要檢查的數(shù)字

//返回值:0:不是數(shù)字 1:是數(shù)字

%

function checkNum(num){

var i,j,strTemp;

strTemp="0123456789";

if(num.length==0)

return 0;

for(i=0;inum.length;i++){

j=strTemp.indexOf(num.charAt(i));

if (j==-1){

return 0;

}

}

return 1;

}

%

//函數(shù)名:chkid

//功能介紹:檢查身份證

//參數(shù)說明:要檢查的字符串

//返回值:0:不合格 1:合格

%

function chkid(id){

if(id.length!=15 id.length!=18){

return 0;

}

else if(chkspc(id)!=1){

return 0;

}

else if(checkNum(id)==0){

return 0;

}

else

return 1;

}

%

//函數(shù)名:checkZip

//功能介紹:檢查是否為有效的郵政編碼

//參數(shù)說明:要檢查的數(shù)字

//返回值:1為是有效的,0為不是有效的

%

function checkZip(zip){

if(zip.length!=6){

return 0;

}

else if(checkNum(zip)==0){

return 0;

}

}

%

//檢查電子郵件是否合法

//函數(shù)名:chkemail

//參數(shù)說明:要檢查的字符串

//返回值:1:是

%

function chkemail(a){

var i=a.length;

var temp = a.indexOf('@');

var tempd = a.indexOf('.');

if(temp 1) {

if((i-temp) 3){

if((i-tempd)0){

return 1;

}

}

}

}

%

//檢查出生年份是否符合規(guī)定

//返回值:0:不正確 1:正確

%

function chkYear(year){

if(year.length!=4)

return 0;

if(checkNum(year)==0)

return 0;

else if(chkspc(year)!=1)

return 0;

else

return 1;

}

--

/script

script language="javascript"

var xmlHttp;

function createXMLHttpRequest(){

if(window.ActiveXObject){

xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");

}else if(window.XMLHttpRequest){

xmlHttp = new XMLHttpRequest();

}

}

function startRequest(){

createXMLHttpRequest();

xmlHttp.onreadystatechange = handleStateChange;

var uname = document.getElementById("userName").value;

xmlHttp.open("POST","RegAjax?name="+uname,true);

xmlHttp.send(null);

}

function handleStateChange(){

if(xmlHttp.readyState==4){

if(xmlHttp.status==200){

if("t"==(xmlHttp.responseText))

alert("用戶名已被占用");

}

}

}

/script

/head

body

%

if("OK".equals(request.getSession().getAttribute("reginfo"))){

response.setHeader("refresh","2;URL=../index.jsp");

%

注冊成功啦。br

兩秒鐘后返回首頁,如果沒有返回br

請點這里a href="../index.jsp"返回/a主頁

%

}else{

if(request.getSession().getAttribute("reginfo")!=null){

%

center%=(String)request.getSession().getAttribute("reginfo") %/center

%} %

form name="RegInfoPost" method="post" action="reg.do"

table width="615" height="617" border="0" align="center"

tra href="./index.jsp"點這返回首頁/a

td colspan="4"hr color="#cccccc" noshade="yes" size="1"/td

/tr

tr

td colspan="4"hr color="#cccccc" noshade="yes" size="1"/td

/tr

tr

td width="150" height="30" valign="top"!--DWLayoutEmptyCell--?/td

td width="339" valign="middle"

span class="style2"strong用戶帳號:/strong/span

input name="userName" type="text" class="item_table" id="userName" maxlength="16" OnBlur="startRequest()"

span class="error"*(6-16個字符)/span /td

td width="126" valign="middle"

/td

/tr

tr

td?/td

td valign="middle"strong用戶密碼:/strong input name="password" type="password" class="item_table" id="password" maxlength="16"

span class="error"*(6-16個字符) /span /td

td?/td

/tr

tr

td height="30"?/td

td valign="middle" strong確認(rèn)密碼:/strong input name="password2" type="password" class="item_table" id="password2" maxlength="16"

span class="error"*(請確認(rèn)密碼)/span /td

td?/td

/tr

tr align="center" valign="middle"

td height="30" colspan="3" valign="middle"hr color="#cccccc" noshade="yes" size="1"/td

/tr

tr align="center" valign="middle"

td height="20" colspan="3"span class="error"密碼保護(在您忘記密碼時,將通過以下問題來重新獲得您的密碼)/span/td

/tr

tr align="center" valign="middle"

td height="30"?/td

td colspan="2" align="left" valign="middle"strong密碼提示問題:/strong input name="question" type="text" class="item_table" id="question" maxlength="20"

span class="error"*(不超過20個字符)/span /td

/tr

tr align="center" valign="middle"

td height="30"?/td

td colspan="2" align="left" valign="middle"strong密碼提示答案:/strong input name="answer" type="text" class="item_table" id="answer" maxlength="10"

span class="error"*(不超過10個字符)/span /td

/tr

tr

td height="14" colspan="2" valign="top"strong姓名/strongfont color="#ff0000"span class="error"*/span/td

td colspan="2" valign="top"strong身份證號碼/strongfont color="#ff0000"span class="error"*/span/td

/tr

tr

td height="18" colspan="2" valign="top"

input name="realName" type="text" id="realname" /td

td colspan="2" valign="top"input name="identityCard" type="text" id="identityCard" size="18" maxlength="18"/td

/tr

tr

td width="116" height="14"?/td

td width="185"?/td

td width="127"?/td

td width="169"?/td

/tr

tr

tdstrong國家或地區(qū)/strongfont color="#ff0000"span class="error"*/span/td

tdstrong郵政編碼/strongfont color="#ff0000"span class="error"*/span/td

tdstrong省市自治區(qū)/strongfont color="#ff0000"span class="error"*/span/td

tdstrong城市/strongfont color="#ff0000"span class="error"*/span/td

/tr

tr

td

select name="country" id="country"

option selected中國/option

option中國香港/option

option中國澳門/option

option中國臺灣/option

/select

/td

td

input name="zip" type="text" id="zip"

/td

td

select name="state" id="state" onclick="selectCity()"

option value="default" selected name="value" isCity="false"選擇省市自治區(qū)/option

option name="value" value="北京" isCity="true"北京/option

option name="value" value="上海" isCity="true"上海/option

option name="value" value="天津" isCity="true"天津/option

option name="value" value="重慶" isCity="true"重慶/option

option name="value" value="安徽省" isCity="false"安徽省/option

option name="value" value="福建省" isCity="false"福建省/option

option name="value" value="甘肅省" isCity="false"甘肅省/option

option name="value" value="廣東省" isCity="false"廣東省/option

option name="value" value="廣西壯族自治區(qū)" isCity="false"廣西壯族自治區(qū)/option

option name="value" value="貴州省" isCity="false"貴州省/option

option name="value" value="海南省" isCity="false"海南省/option

option name="value" value="河北省" isCity="false"河北省/option

option name="value" value="河南省" isCity="false"河南省/option

option name="value" value="黑龍江省" isCity="false"黑龍江省/option

option name="value" value="湖北省" isCity="false"湖北省/option

option name="value" value="湖南省" isCity="false"湖南省/option

option name="value" value="吉林省" isCity="false"吉林省/option

option name="value" value="江蘇省" isCity="false"江蘇省/option

option name="value" value="江西省" isCity="false"江西省/option

option name="value" value="遼寧省" isCity="false"遼寧省/option

option name="value" value="內(nèi)蒙古自治區(qū)" isCity="false"內(nèi)蒙古自治區(qū)/option

option name="value" value="寧夏回族自治區(qū)" isCity="false"寧夏回族自治區(qū)/option

option name="value" value="青海省" isCity="false"青海省/option

option name="value" value="山東省" isCity="false"山東省/option

option name="value" value="山西省" isCity="false"山西省/option

option name="value" value="陜西省" isCity="false"陜西省/option

option name="value" value="四川省" isCity="false"四川省/option

option name="value" value="臺灣省" isCity="false"臺灣省/option

option name="value" value="西藏自治區(qū)" isCity="false"西藏自治區(qū)/option

option name="value" value="新疆維吾爾自治區(qū)" isCity="false"新疆維吾爾自治區(qū)/option

option name="value" value="云南省" isCity="false"云南省/option

option name="value" value="浙江省" isCity="false"浙江省/option

option name="value" value="中國香港" isCity="true"中國香港/option

option name="value" value="中國澳門" isCity="true"中國澳門/option

/select

/td

td

input name="city" type="text" id="city" onfocus="checkCity()"

/td

/tr

tr

td colspan="4"?/td

/tr

tr

td colspan="4"strong送貨地址/strongfont color="#ff0000"span class="error"*/span/td

/tr

tr

td colspan="4"

input name="address" type="text" id="address" size="41"

/td

/tr

tr

td colspan="4"?/td

/tr

tr

td colspan="2"strong主要聯(lián)系電話/strongfont color="#ff0000"span class="error"*/span/td

/tr

tr

td colspan="2"

input name="phone" type="text" id="phone"

/td

/tr

tr

td colspan="4"?/td

/tr

tr

td colspan="4"hr color="#cccccc" noshade="yes" size="1"/td

/tr

tr

td colspan="4"span class="error"請?zhí)顚懻鎸嵱行У碾娮余]件地址/span/td

/tr

tr

td colspan="4"strong電子郵件地址font color="#ff0000"/strongspan class="error"*/span/td

/tr

tr

td colspan="4"

input name="email" type="text" id="email" size="40" /td

/tr

tr

td colspan="4" span class="style2"范例:/spanspan class="style3" myname@hotmail.com/span/td

/tr

tr

td colspan="4" strong請再一次輸入您的電子郵件地址/strongfont color="#ff0000"span class="error"*/span/td

/tr

tr

td colspan="4"

input name="email2" type="text" id="email2" size="40" /td

/tr

tr

td colspan="4"hr color="#cccccc" noshade="yes" size="1"/td

/tr

tr

td colspan="4"?/td

/tr

tr

td?/tdtd colspan="2"div align="center"strong接受用戶協(xié)議/strong/div/td

/tr

tr

td height="87" colspan="4"div align="center"

textarea name="textarea" cols="70" rows="15" wrap="VIRTUAL" 本網(wǎng)站僅為威迅教育交流學(xué)習(xí)之用,您必須無條件接受以下條件方可繼續(xù)注冊。

一、不得利用本站危害國家安全、泄露國家秘密,不得侵犯國家社會集體的和公民的合法權(quán)益,不得利用本站制作、復(fù)制和傳播下列信息:

(一)煽動抗拒、破壞憲法和法律、行政法規(guī)實施的;

(二)煽動顛覆國家政權(quán),推翻社會主義制度的;

(三)煽動分裂國家、破壞國家統(tǒng)一的;

(四)煽動民族仇恨、民族歧視,破壞民族團結(jié)的;

(五)捏造或者歪曲事實,散布謠言,擾亂社會秩序的;

(六)宣揚封建迷信、淫穢、色情、賭 bo、暴力、兇殺、恐怖、教唆犯罪的;

(七)公然侮辱他人或者捏造事實誹謗他人的,或者進(jìn)行其他惡意攻擊的;

(八)損害國家機關(guān)信譽的;

(九)其他違反憲法和法律行政法規(guī)的;

(十)進(jìn)行商業(yè)廣告行為的。

二、互相尊重,對自己的言論和行為負(fù)責(zé)。 /textarea

/div/td

/tr

tr

td colspan="4"div align="center"strong當(dāng)通過點擊”注冊“按鈕即表示我已無條件接受以上協(xié)議/strong/div/td

/tr

tr

td colspan="4"hr color="#cccccc" noshade="yes" size="1"/td

/tr

tr

td colspan="4"div align="center"

input type="submit" name="Submit" value="注冊" onClick="return onSubmit()"

input type="reset" name="Reset" value="重置"

/div/td

/tr

tr

td height="46" colspan="4"?/td

/tr

/table

/form

%} %

/body

/html

編寫用戶注冊于登錄的JSP頁面的全部程序代碼

3個jsp文件,第一個是login.jsp,第二個是judge.jsp,第三個是afterLogin.jsp

%@ page language="java" contentType="text/html; charset=GB18030"

pageEncoding="GB18030"%

%@ page import="java.util.*" %

!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

html

head

title登錄頁面/title

/head

body

form name="loginForm" method="post" action="judgeUser.jsp"

table

tr

td用戶名:input type="text" name="userName" id="userName"/td

/tr

tr

td密碼:input type="password" name="password" id="password"/td

/tr

tr

tdinput type="submit" value="登錄" style="background-color:pink" input type="reset" value="重置" style="background-color:red"/td

/tr

/table

/form

/body

/html

%@ page language="java" contentType="text/html; charset=GB18030"

pageEncoding="GB18030"%

%@ page import="java.util.*" %

!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

html

head

title身份驗證/title

/head

body

%

request.setCharacterEncoding("GB18030");

String name = request.getParameter("userName");

String password = request.getParameter("password");

if(name.equals("abc") password.equals("123")) {

%

jsp:forward page="afterLogin.jsp"

jsp:param name="userName" value="%=name%"/

/jsp:forward

%

}

else {

%

jsp:forward page="login.jsp"/

%

}

%

/body

/html

%@ page language="java" contentType="text/html; charset=GB18030"

pageEncoding="GB18030"%

!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

html

head

title登錄成功/title

/head

body

%

request.setCharacterEncoding("GB18030");

String name = request.getParameter("userName");

out.println("歡迎你:" + name);

%

/body

/html

網(wǎng)站名稱:java注冊jsp代碼,jsp登錄注冊代碼
分享路徑:http://chinadenli.net/article24/dsehdce.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供微信小程序外貿(mào)建站企業(yè)網(wǎng)站制作微信公眾號外貿(mào)網(wǎng)站建設(shè)靜態(tài)網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站網(wǎng)頁設(shè)計