本文目錄一覽:
- 1、用jsp+mysql製作班級留言板,最好能實現圖中的效果,盡量發完整代碼,哪位大神會
- 2、JSP實現留言板留言 但是我這個就只能留一個 然後 再留言就覆蓋了 我怎麼可以一直留下去
- 3、jsp使用session做一個留言板
- 4、怎麼樣製作留言版
- 5、網上下的jsp源碼要怎麼用
用jsp+mysql製作班級留言板,最好能實現圖中的效果,盡量發完整代碼,哪位大神會
採用純jsp頁面+Mysql的方法實現功能
項目編碼是gb2312,要轉換格式的請自己裝換,界面簡潔,功能簡單,實現容易,非常適合初學者
有助於加深初學者對jsp的理解和使用Mysql數據庫
String DBDRIVER = “com.mysql.jdbc.Driver”;
String DBURL =”jdbc:mysql://localhost:3306/db_jsp?characterEncoding=utf-8″; //數據庫名:tianming
String DBUSER = “root”; //mysql數據庫用戶名
String DBPASSWORD = “root”; //mysql數據庫密碼
功能說明:【留言內容過長的用… 代替】
權限設置:分為學生用戶和管理員用戶【不可直接訪問頁面,必須登陸後才可以進入】
普通用戶的可以實現發布內容、查看內容
管理員用戶的可以實現發布內容、查看內容、 刪除留言、編輯留言
可以在登錄頁面進行註冊
頁面介紹:
zhuce.jsp 註冊頁面
login.jsp 用戶登錄界面
login_conf.jsp 用戶登錄驗證
login_success.jsp 用戶登錄成功提示
list_notes.jsp 發布內容顯示和查詢結果顯示頁面
insert.jsp 添加新內容頁面
。。。。。。。。。。。。
使用到的數據:db_jsp.sql【位於項目的web頁中】
使用方法一: 使用mysql命令行: create database db_jsp;
use db_jsp;把文件內容複製粘貼到命令行即可
使用方法一: 在mysql中新建一個名為db_jsp的數據庫;導入db_jsp.sql 文件即可
JSP實現留言板留言 但是我這個就只能留一個 然後 再留言就覆蓋了 我怎麼可以一直留下去
首先你要在result.jsp裡面創建一個LinkedList, 每次按照原來的拼接message變量後,在後面也拼接上當前時間, 然後吧message加入到LinkedList變量中
index.jsp頁面拿到保存在session中的LinkedList, 按照順序打印出來就OK了
當然你的代碼也可以直接改.只是順序的問題而已
session.setAttribute(“message”,message) 和他下面的哪一行調換位置就行了
jsp使用session做一個留言板
網上有開源代碼
關鍵詞java 源代碼 留言板應該就能出來
我記得很早以前我很容易就找到過一個
怎麼樣製作留言版
jsp留言板源代碼1
oracle數據表創建.
create table guestbook (
lw_title varchar2(100) not null, –留言主題
lw_author varchar2(20) not null, –網上大名 pk
author_http varchar2(40) , –主頁地址
author_email varchar2(40) not null,–電子信箱 pk
expression varchar2(2) not null,–表情
lw_time varchar2(14) not null,–發表回應時間
answer_num number(3) not null,–回應數
click_num number(4) not null,–點擊數
author_ip varchar2(16) ,–來源ip
lw_class1 varchar2(10) not null,–留言板大類 pk
lw_class2 varchar2(20) not null,–論壇欄目 pk
lw_type varchar2(1) not null,–留言類別,即是否為主貼
zt_time varchar2(14) ,–主貼時間
zt_author varchar2(40) ,–主貼email
lw_content varchar2(4000) ,–內容
constraint pk_guestbook primary key(lw_class1,lw_class2,lw
_time,lw_author)
) storage (initial 5M next 5M pctincrease 1);
jsp留言板源代碼2
guestbook.jsp
===========================
htmlhead
META content=”text/html; charset=gb2312 ” http-equiv=Content-Type
title張家界電話黃頁(網上114)/title/head
style type=”text/css”
!–
BODY { FONT-FAMILY: “宋體”,”Arial Narrow”, “Times New Roman”; FONT-SI
ZE: 9pt }
.p1 { FONT-FAMILY: “宋體”, “Arial Narrow”, “Times New Roman”; FONT-SIZ
E: 12pt }
A:link { COLOR: #00793d; TEXT-DECORATION: none }
A:visited { TEXT-DECORATION: none }
A:hover { TEXT-DECORATION: underline}
TD { FONT-FAMILY: “宋體”, “Arial Narrow”, “Times New Roman”; FONT-SIZE
: 9pt }
.p2 { FONT-FAMILY: “宋體”, “Arial Narrow”, “Times New Roman”; FONT-SIZ
E: 9pt; LINE-HEIGHT: 150% }
.p3 { FONT-FAMILY: “宋體”, “Arial Narrow”, “Times New Roman”; FONT-SIZ
E: 9pt; LINE-HEIGHT: 120% }
—
/style
body
%@ page contentType=”text/html; charset=GB2312″ %
%@ page language=”java” import=”java.sql.*” %
jsp:useBean id=”testInq” scope=”page” class=”ymbean.opDb” /
%
int pages=1;
int pagesize=10;
int count=0;
int totalpages=0;
String countsql=””,inqsql=””,lwhere=””,insertsql=””,st=””;
String lw_title=””,lw_author=””,pagetitle=””,author_http=””,author_e
mail=””,lw_ico=””,
lw_content=””,lw_class1=””;
String author_ip=””,lw_time=””,lw_class2=””,lw_type=””,zt_time=””,zt
_author=””;
int answer_num=0,click_num=0;
int inquire_item=1;
String inquire_itemt=””,inquire_value=””;
String lurlt=”a href=guestbook.jsp?”,llink=””;
lwhere=” where lw_type=z “; //只顯示主貼
/*
Enumeration e = request.getParameterNames();
while (e.hasMoreElements()) {
String name = (String) e.nextElement();
*/
try{
//取顯示的頁頁序數
pages = new Integer(request.getParameter(“pages”)).intValue();
} catch (Exception e) {}
try{
//取查詢參數
inquire_item=new Integer(request.getParameter(“range”)).intValu
e();
inquire_value=new String(request.getParameter(“findstr”).getByt
es(“ISO8859_1”));
if(inquire_item==0) inquire_itemt=”lw_title”;
else if(inquire_item==1) inquire_itemt=”lw_content”;
else if(inquire_item==2) inquire_itemt=”lw_author”;
else if(inquire_item==3) inquire_itemt=”lw_time”;
else if(inquire_item==4) inquire_itemt=”lw_title”;
lwhere=lwhere+” and “+inquire_itemt+” like %”+inquire_value+”%
“;
lurlt=lurlt+”range=”+inquire_item+”findstr=”+inquire_value+””
;
} catch (Exception e) {}
try{
//取得參數 留言內容
lw_class1=new String(request.getParameter(“gbname”).getBytes(“ISO885
9_1″));
lw_title=new String(request.getParameter(“lw_title”).getBytes(“ISO88
59_1″));
lw_author=new String(request.getParameter(“lw_author”).getBytes(“ISO
8859_1″));
pagetitle=new String(request.getParameter(“pagetitle”).getBytes(“ISO
8859_1″));
author_http=new String(request.getParameter(“author_http”).getBytes(
“ISO8859_1”));
author_email=new String(request.getParameter(“author_email”).getByte
s(“ISO8859_1”));
lw_ico=request.getParameter(“gifface”);
lw_content=new String(request.getParameter(“lw_content”).getBytes(“I
SO8859_1″));
String requestMethod=request.getMethod();
requestMethod=requestMethod.toUpperCase();
if(requestMethod.indexOf(“POST”)0)
{ out.print(“非法操作!”);
return;
}
//形成其他數據項
author_ip=request.getRemoteAddr() ;
lw_time=testInq.getCurrentDate(“yyyyMMddHHmmss”);
lw_class2=”2″;
lw_type=””+”z”; //主貼
zt_time=lw_time;
zt_author=lw_author;
answer_num=0;
click_num=0;
//================
st=”,”;
//保證留言所有數據項的長度在正常範圍內
if(lw_title.length()50) lw_title=lw_title.substring(0,50);
if(lw_author.length()20) lw_author=lw_author.substring(0,20);
if(author_http.length()40) author_http=author_http.substring(0,40);
if(author_email.length()50) author_email=author_email.substring(0,4
0);
if(lw_content.length()4000) lw_content=lw_content.substring(0,4000)
;
insertsql=”insert into guestbook values(“+lw_title+st+lw_author+st+
author_http+st+
author_email+st+lw_ico+st+lw_time+”,”+answer_num+”,”+cli
ck_num+”,”+
author_ip+st+lw_class1+st+lw_class2+st+lw_type+st+zt_time
+st+zt_author+st+
lw_content+”)”;
//out.print(insertsql);
//插入留言
try{
String lmsg=testInq.executeUpdate(insertsql);
if(lmsg.indexOf(“executeUpdate ok”)0)
out.print(“lmsg=”+lmsg);
}catch (Exception e) { out.print(“錯誤:”+e);}
} catch (Exception e) {}
%
%
//驗證留言輸入項合法性的javascript
String ljs=” SCRIPT language=JavaScript “+
” !– “+
” function ValidInput() “+
” {if(document.sign.lw_author.value==””) “+
” {alert(“請填寫您的大名。”); “+
” document.sign.lw_author.focus(); “+
” return false;} “+
” if(document.sign.lw_title.value==””) “+
” {alert(“請填寫留言主題。”); “+
” document.sign.lw_title.focus(); “+
” return false;} “+
” if (document.sign.author_email.value!=””) “+
” { if ((document.sign.author_email.value.indexOf(“@”)0)//(document
.sign.author_email.value.indexOf(“:”)!=-1)) “+
” {alert(“您填寫的EMail無效,請填寫一個有效的Email!”); “+
” document.sign.author_emaill.focus(); “+
” return false; “+
” } “+
” } “+
” return true; “+
” } “+
” function ValidSearch() “+
” { if(document.frmsearch.findstr.value==””) “+
” {alert(“不能搜索空串!”); “+
” document.frmsearch.findstr.focus(); “+
” return false;} “+
” } “+
” //– “+
” /SCRIPT “;
out.print(ljs);
%
%
//留言板界面首部
String ltop=” DIV align=center “+
” CENTER “+
” FORM action=guestbook.jsp method=post name=frmsearch “+
” INPUT name=gbname type=hidden value=cnzjj_gt “+
” TABLE align=center border=0 cellSpacing=1 width=”95%” “+
” TBODY “+
” TR “+
” TD bgColor=#336699 colSpan=2 width=”100%” “+
” P align=centerFONT color=#ffffff face=楷體_GB2312 “+
” size=5歡迎遠方的朋友來張家界旅遊觀光/FONT/P/TD/TR ”
+
” TR bgColor=#6699cc “+
” TD align=left noWrap width=”50%”主頁: A “+
” href=”” target=_blankFONT “+
” color=#ffffff張家界旅遊/FONT/A 管理員: A ”
+
” href=”mailto:dzx@mail.zj.hn.cninfo.net”FONT color=#ffffff
一民/FONT/A “+
” A “+
” href=” “FONT “+
” color=#ffffff管理/FONT/A A “+
” href=” “FONT “+
” color=#ffffff申請/FONT/A /TD “+
” TD align=right width=”50%”SELECT class=ourfont name=range s
ize=1 “+
” OPTION selected value=0按主題/OPTION OPTION value=1按內
容/OPTION “+
” OPTION value=2按作者/OPTION OPTION value=3按日期/OPTI
ON OPTION “+
” value=4按主題內容/OPTION/SELECT INPUT name=findst
r INPUT name=search onclick=”return ValidSearch()” type=submit val
ue=”搜 索” “+
” /TD/TR/TBODY/TABLE/FORM “+
” HR align=center noShade SIZE=1 width=”95%” “+
” /CENTER/div “;
out.print(ltop);
%
%
//顯示最近時間發表的一頁留言
countsql=”select count(lw_title) from guestbook “+lwhere;
inqsql =”select lw_title,answer_num,click_num,lw_author,lw_time,expres
sion,”+
” author_email,lw_class1,lw_class2 from guestbook “+lwhere+” o
rder by lw_time desc” ;
if(pages0)
{
try {
try{
ResultSet rcount=testInq.executeQuery(countsql);
if(rcount.next())
{
count = rcount.getInt(1);
}
rcount.close();
} catch (Exception el1) { out.println(“count record error
: “+el1+”
” );
out.println(countsql);
}
totalpages=(int)(count/pagesize);
if(counttotalpages*pagesize) totalpages++;
st=””+
” TABLE align=center border=0 cellPadding=0 cellSpacing=
0 width=”95%” “+
” TBODY TR TD align=middle bgColor=#97badd width=”1
00%”FONT color=#ff0000″+
” 共 “+totalpages+” 頁,”+count+”
條. “+” 當前頁: “+pages+
” /FONT/TD/TR/TBODY/TABLEBR “;
out.print(st);
//out.print(” 共 “+totalpages+” 頁,”+
count+” 條. “+” 當前頁: “+pages+”
“);
st=” center “+
” TABLE border=0 cellPadding=2 cellSpacing=1 width=”95%” “+
” TBODY “+
” TR “+
” TD align=middle bgColor=#6699cc width=”55%”FONT “+
” color=#ffffff留言主題/FONT/TD “+
” TD align=middle bgColor=#6699cc width=50FONT “+
” color=#ffffff回應數/FONT/TD “+
” TD align=middle bgColor=#6699cc width=40FONT “+
” color=#ffffff點擊數/FONT/TD “+
” TD align=middle bgColor=#6699cc width=100FONT “+
” color=#ffffff作者名/FONT/TD “+
” TD align=middle bgColor=#6699cc width=140FONT “+
” color=#ffffff發表/回應時間/FONT/TD/TR “;
out.print(st);
if(count 0 )
{
ResultSet rs = testInq.executeQuery(inqsql);
ResultSetMetaData metaData = rs.getMetaData();
int i;
// 跳過pages -1 頁,使cursor指向pages並準備顯示
for(i=1;i=(pages – 1)*pagesize;i++) rs.next();
//顯示第pages頁開始
String linestr=””;
for(i=1;i=pagesize;i++)
if(rs.next())
{
lw_title=rs.getString(“lw_title”);
answer_num=rs.getInt(“answer_num”);
click_num=rs.getInt(“click_num”);
lw_author=rs.getString(“lw_author”);
lw_time=rs.getString(“lw_time”);
st=lw_time.substring(0,4)+”-“+lw_time.substring(4,6)+”-”
+lw_time.substring(6,8)+”:”+
lw_time.substring(8,10)+”:”+lw_time.substring(10,12)+
“:”+lw_time.substring(12,14);
lw_ico=rs.getString(“expression”);
author_email=rs.getString(“author_email”);
lw_class1=rs.getString(“lw_class1”);
lw_class2=rs.getString(“lw_class2”);
llink=”reply.jsp?lw_class1=”+lw_class1+”lw_class2=”+lw_
class2+”zt_time=”+lw_time+
“zt_author=”+author_email;
linestr=” TR bgColor=#d5e8fd ” +
” TD bgColor=#d5e8fdIMG src=””+lw_ico+”.gif
“A “+
” href=””+llink+” “”+lw_title+”/A/TD “+
” TD align=middle[“+answer_num+”]/TD”+
” TD align=middle”+click_num+”/TD”+
” TD align=middleA href=”mailto:”+author_ema
il+”””+lw_author+”/A/TD”+
” TD align=middle”+st+”/TD/TR”;
out.println(linestr);
}
rs.close();
//顯示第pages頁結束
st=”/TBODY/TABLEBR”;
out.print(st);
int iFirst=1,iLast=totalpages,iPre,iNext;
if(pages=1) iPre=1;
else iPre=pages – 1;
if(pages=totalpages) iNext=totalpages;
else iNext=pages + 1;
int n=(int)(count/pagesize);
if(n*pagesizecount) n++;
if(n1)
{
//for(i=1;i=n;i++) out.print(“a href=inquire.jsp?pages=
“+i+””+i+” /a”);
//out.print(“HR align=center noShade SIZE=1 width=”95%
“”);
String lt1=”返回主頁”,lt2=”第一頁”,lt3=”上一頁”,lt4=”下一
頁”,lt5=”最後一頁”,lt6=””;
lt6=”a href=;”+ lt1 + ” /
a”+
lurlt + “pages=”+iFirst+”FONT color=red”+lt2+”nbs
p; /a”+
lurlt + “pages=”+iPre+”FONT color=red”+lt3+”
/a” +
lurlt + “pages=”+iNext+”FONT color=red”+lt4+”
; /a” +
lurlt + “pages=”+iLast+”FONT color=red”+lt5+”
; /a”;
st=””+
” TABLE align=center border=0 cellPadding=0 cellSpacing=
0 width=”95%” “+
” TBODY TR TD align=middle bgColor=#97badd width=”1
00%”FONT color=#ff0000″+
lt6+
” /FONT/TD/TR/TBODY/TABLEBR “;
out.print(st);
}
}
} catch (Exception e) { out.println(“error: “+e); }
}
%
%
//留言板界面尾部
String lbottom=””;
lbottom=lbottom+
” “+
” FORM action=guestbook.jsp method=post name=sign “+
” INPUT name=gbname type=hidden value=cnzjj_gt “+
” INPUT name=pages type=hidden value=1 “+
” TABLE bgColor=#d5e8fd border=0 cellSpacing=1 width=”95%” “+
” TBODY “+
” TR “+
” TD align=middle bgColor=#e6e6fa colSpan=2 noWrapSTRONGFONT
color=blue “+
” face=楷體_GB2312 size=5發 表 意 見/FONT/STRONG nbs
p; [加*的內容必須填寫] /TD/TR “+
” TR “+
” TD noWrap width=”45%” “+
” DIV align=left “+
” TABLE bgColor=#d5e8fd border=0 cellSpacing=1 width=”100%”
“+
” TBODY “+
” TR “+
” TD noWrap width=”100%”*留言主題:INPUT maxLength=40 n
ame=lw_title “+
” size=36/TD/TR “+
” TR “+
” TD noWrap width=”100%”*網上大名:INPUT maxLength=18 n
ame=lw_author “+
” size=36/TD/TR “+
” TR “+
” TD noWrap width=”100%” 主頁標題:INPUT maxLength
=40 name=pagetitle “+
” size=36/TD/TR “+
” TR “+
” TD noWrap width=”100%” 主頁地址:INPUT maxLength
=255 name=author_http “+
” size=36/TD/TR “+
” TR “+
” TD noWrap width=”100%”*電子郵件:INPUT maxLength=40 n
ame=author_email “+
” size=36/TD/TR/TBODY/TABLE/DIV/TD “+
” TD noWrap vAlign=top width=”55%” “+
” DIV align=left “+
” TABLE bgColor=#b6d7fc border=0 cellSpacing=1 width=”100%”
“+
” TBODY “+
” TR “+
” TD width=”100%”請在下面填寫你的留言:/TD/TR “+
” TR “+
” TD width=”100%”TEXTAREA cols=50 name=lw_content rows=
7/TEXTAREA/TD/TR/TBODY/TABLE/DIV/TD/TR “+
” TR “+
” TD bgColor=#fbf7ea colSpan=2 noWrap表情 “+
” INPUT name=gifface type=radio value=1 checkedIMG “+
” alt=”1.gif (152 bytes)” height=15 src=”1.gif” width=15 I
NPUT “+
” name=gifface type=radio value=2IMG alt=”2.gif (174 bytes)”
height=15 “+
” src=”2.gif” width=15 INPUT name=gifface type=radio value=3
IMG “+
” alt=”3.gif (147 bytes)” height=15 src=”3.gif” width=15 I
NPUT “+
” name=gifface type=radio value=4IMG alt=”4.gif (172 bytes)”
height=15 “+
” src=”4.gif” width=15 INPUT name=gifface type=radio value=5
IMG “+
” alt=”5.gif (118 bytes)” height=15 src=”5.gif” width=15 I
NPUT “+
” name=gifface type=radio value=6IMG alt=”6.gif (180 bytes)”
height=15 “+
” src=”6.gif” width=15 INPUT name=gifface type=radio value=7
IMG “+
” alt=”7.gif (180 bytes)” height=15 src=”7.gif” width=15 I
NPUT “+
” name=gifface type=radio value=8IMG alt=”8.gif (96 bytes)”
height=15 “+
” src=”8.gif” width=15 INPUT name=gifface type=radio value=9
IMG “+
” alt=”9.gif (162 bytes)” height=15 src=”9.gif” width=15 I
NPUT “+
” name=gifface type=radio value=10IMG alt=”10.gif (113 bytes)
” height=15 “+
” src=”10.gif” width=15 INPUT name=gifface type=radio value=
11IMG “+
” alt=”11.gif (93 bytes)” height=15 src=”11.gif” width=15
INPUT “+
” name=gifface type=radio value=12 IMG alt=”12.gif (149 bytes
)” height=14 “+
” src=”12.gif” width=15 “+
” INPUT “+
” name=gifface type=radio value=13 IMG alt=”13.gif (149 bytes
)” height=14 “+
” src=”13.gif” width=15 “+
” INPUT “+
” name=gifface type=radio value=14 IMG alt=”14.gif (149 bytes
)” height=14 “+
” src=”14.gif” width=15 “+
” INPUT “+
” name=gifface type=radio value=15 IMG alt=”15.gif (149 bytes
)” height=14 “+
” src=”15.gif” width=15 “+
” INPUT “+
” name=gifface type=radio value=16 IMG alt=”16.gif (149 bytes
)” height=14 “+
” src=”16.gif” width=15 /TD “+
” /TR “+
” TR “+
” TD align=middle colSpan=2 noWrapINPUT name=cmdGO onclick=”re
turn ValidInput()” type=submit value=”提 交” “+
” INPUT name=cmdPrev onclick=”return ValidInput()” type=submit valu
e=”預 覽” “+
” INPUT name=cmdCancel type=reset value=”重 寫” INPU
T name=cmdBack onclick=javascript:history.go(-1) type=button value=”返
回” “+
” /TD/TR/TBODY/TABLE/FORM/CENTER/DIV “;
out.print(lbottom);
%
/body/html
jsp留言板源代碼3
reply.jsp
====================================
htmlhead
META content=”text/html; charset=gb2312 ” http-equiv=Content-Type
title張家界電話黃頁(網上114)/title/head
style type=”text/css”
!–
BODY { FONT-FAMILY: “宋體”,”Arial Narrow”, “Times New Roman”; FONT-SI
ZE: 9pt }
.p1 { FONT-FAMILY: “宋體”, “Arial Narrow”, “Times New Roman”; FONT-SIZ
E: 12pt }
A:link { COLOR: #00793d; TEXT-DECORATION: none }
A:visited { TEXT-DECORATION: none }
A:hover { TEXT-DECORATION: underline}
TD { FONT-FAMILY: “宋體”, “Arial Narrow”, “Times New Roman”; FONT-SIZE
: 9pt }
.p2 { FONT-FAMILY: “宋體”, “Arial Narrow”, “Times New Roman”; FONT-SIZ
E: 9pt; LINE-HEIGHT: 150% }
.p3 { FONT-FAMILY: “宋體”, “Arial Narrow”, “Times New Roman”; FONT-SIZ
E: 9pt; LINE-HEIGHT: 120% }
—
/style
body
%@ page contentType=”text/html; charset=GB2312″ %
%@ page language=”java” import=”java.sql.*” %
jsp:useBean id=”testInq” scope=”page” class=”ymbean.opDb” /
%
int pages=1;
int pagesize=10;
int count=0;
int totalpages=0;
String countsql=””,inqsql=””,updatesql=””,lwhere=””,insertsql=””,st=
“”;
String lw_title=””,lw_author=””,pagetitle=””,author_http=””,author_e
mail=””,lw_ico=”0″,
lw_content=””,lw_class1=””;
String author_ip=””,lw_time=””,lw_class2=””,lw_type=””,zt_time=””,zt
_author=””;
int answer_num=0,click_num=0;
int inquire_item=1;
String inquire_itemt=””,inquire_value=””;
String lurlt=”a href=reply.jsp?”;
lwhere=” where “; //只顯示主貼
/*
Enumeration e = request.getParameterNames();
while (e.hasMoreElements()) {
String name = (String) e.nextElement();
*/
try{
//取顯示的頁頁序數
pages = new Integer(request.getParameter(“pages”)).intValue();
} catch (Exception e) {}
try{
//取查詢參數
lw_class1=new String(request.getParameter(“lw_class1”).getBytes
(“ISO8859_1”));
lw_class2=new String(request.getParameter(“lw_class2”).getBytes
(“ISO8859_1”));
zt_time=new String(request.getParameter(“zt_time”).getBytes(“IS
O8859_1″));
zt_author=new String(request.getParameter(“zt_author”).getBytes
(“ISO8859_1”));
lwhere=” where ( lw_class1=”+lw_class1+” and lw_class2=”+lw_
class2+
” and (lw_time=”+ zt_time+” or zt_time=”+zt_time+
“) and (author_email=”+zt_author+” or zt_author=”+zt
_author+”) ) “;
lurlt=lurlt+”lw_class1=”+lw_class1+”lw_class2=”+lw_class2+”zt
_time=”+zt_time+
“zt_author=”+zt_author+””;
//out.print(lwhere);
} catch (Exception e) { //out.print(“error1: “+e+”hr”);
}
try{
//取得參數 留言內容
lw_class1=new String(request.getParameter(“lw_class1”).getBytes(“ISO
8859_1″));
lw_class2=new String(request.getParameter(“lw_class2”).getBytes(“ISO
8859_1″));
lw_title=new String(request.getParameter(“lw_title”).getBytes(“ISO88
59_1″));
lw_author=new String(request.getParameter(“lw_author”).getBytes(“ISO
8859_1″));
pagetitle=new String(request.getParameter(“pagetitle”).getBytes(“ISO
8859_1″));
author_http=new String(request.getParameter(“author_http”).getBytes(
“ISO8859_1”));
author_email=new String(request.getParameter(“author_email”).getByte
s(“ISO8859_1”));
zt_time=new String(request.getParameter(“zt_time”).getBytes(“ISO8859
_1″));
zt_author=new String(request.getParameter(“zt_author”).getBytes(“ISO
8859_1″));
lw_ico=request.getParameter(“gifface”);
} catch (Exception e) {}
try{
lw_content=new String(request.getParameter(“lw_content”).getBytes(“I
SO8859_1″));
String requestMethod=request.getMethod();
requestMethod=requestMethod.toUpperCase();
if(requestMethod.indexOf(“POST”)0)
{ out.print(“非法操作!”);
return;
}
//形成其他數據項
author_ip=request.getRemoteAddr() ;
lw_time=testInq.getCurrentDate(“yyyyMMddHHmmss”);
lw_type=””+”c”; //從貼
answer_num=0;
click_num=0;
//================
st=”,”;
網上下的jsp源碼要怎麼用
需要部署到服務器中
找到菜單 window → Show View → Servers,打開Servers視圖標籤,部署的Tomcat 服務
在這個服務上右擊,選擇“Add Deployment”
在新打開的對話框中,有一個Project項,選擇要部署的項目
點擊“Finish”完成部署
這樣項目就部署到Tomcat裡面去了
原創文章,作者:小藍,如若轉載,請註明出處:https://www.506064.com/zh-hant/n/156701.html