|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
C#是不行的,比如说美国的航天飞船里就有java开发的程序以上是我的愚见,其实不管那种语言,你学好了,都能找到好的工作,js|源代码reply.jsp
====================================
<html><head>
<METAcontent="text/html;charset=gb2312"http-equiv=Content-Type>
<title>张家界德律风黄页(网上114)</title></head>
<styletype="text/CSS">
<!--
BODY{FONT-FAMILY:"宋体","ArialNarrow","TimesNewRoman";FONT-SI
ZE:9pt}
.p1{FONT-FAMILY:"宋体","ArialNarrow","TimesNewRoman";FONT-SIZ
E:12pt}
A:link{COLOR:#00793d;TEXT-DECORATION:none}
A:visited{TEXT-DECORATION:none}
A:hover{TEXT-DECORATION:underline}
TD{FONT-FAMILY:"宋体","ArialNarrow","TimesNewRoman";FONT-SIZE
:9pt}
.p2{FONT-FAMILY:"宋体","ArialNarrow","TimesNewRoman";FONT-SIZ
E:9pt;LINE-HEIGHT:150%}
.p3{FONT-FAMILY:"宋体","ArialNarrow","TimesNewRoman";FONT-SIZ
E:9pt;LINE-HEIGHT:120%}
-->
</style>
<body>
<%@pagecontentType="text/html;charset=GB2312"%>
<%@pagelanguage="java"import="java.sql.*"%>
<jsp:useBeanid="testInq"scope="page"class="ymbean.opDb"/>
<%
intpages=1;
intpagesize=10;
intcount=0;
inttotalpages=0;
Stringcountsql="",inqsql="",updatesql="",lwhere="",insertsql="",st=
"";
Stringlw_title="",lw_author="",pagetitle="",author_http="",author_e
mail="",lw_ico="0",
lw_content="",lw_class1="";
Stringauthor_ip="",lw_time="",lw_class2="",lw_type="",zt_time="",zt
_author="";
intanswer_num=0,click_num=0;
intinquire_item=1;
Stringinquire_itemt="",inquire_value="";
Stringlurlt="<ahref=reply.jsp?";
lwhere="where";//只显现主贴
/*
Enumeratione=request.getParameterNames();
while(e.hasMoreElements()){
Stringname=(String)e.nextElement();
*/
try{
//取显现的页页序数
pages=newInteger(request.getParameter("pages")).intValue();
}catch(Exceptione){}
try{
//取查询参数
lw_class1=newString(request.getParameter("lw_class1").getBytes
("ISO8859_1"));
lw_class2=newString(request.getParameter("lw_class2").getBytes
("ISO8859_1"));
zt_time=newString(request.getParameter("zt_time").getBytes("IS
O8859_1"));
zt_author=newString(request.getParameter("zt_author").getBytes
("ISO8859_1"));
lwhere="where(lw_class1="+lw_class1+"andlw_class2="+lw_
class2+
"and(lw_time="+zt_time+"orzt_time="+zt_time+
")and(author_email="+zt_author+"orzt_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(Exceptione){//out.print("error1:"+e+"<hr>");
}
try{
//获得参数留言内容
lw_class1=newString(request.getParameter("lw_class1").getBytes("ISO
8859_1"));
lw_class2=newString(request.getParameter("lw_class2").getBytes("ISO
8859_1"));
lw_title=newString(request.getParameter("lw_title").getBytes("ISO88
59_1"));
lw_author=newString(request.getParameter("lw_author").getBytes("ISO
8859_1"));
pagetitle=newString(request.getParameter("pagetitle").getBytes("ISO
8859_1"));
author_http=newString(request.getParameter("author_http").getBytes(
"ISO8859_1"));
author_email=newString(request.getParameter("author_email").getByte
s("ISO8859_1"));
zt_time=newString(request.getParameter("zt_time").getBytes("ISO8859
_1"));
zt_author=newString(request.getParameter("zt_author").getBytes("ISO
8859_1"));
lw_ico=request.getParameter("gifface");
}catch(Exceptione){}
try{
lw_content=newString(request.getParameter("lw_content").getBytes("I
SO8859_1"));
StringrequestMethod=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=",";
//包管留言一切数据项的长度在一般局限内
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(zt_author.length()>50)zt_author=zt_author.substring(0,40);
if(lw_content.length()>4000)lw_content=lw_content.substring(0,4000)
;
insertsql="insertintoguestbookvalues("+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{
st=testInq.executeUpdate(insertsql);
if(st.indexOf("executeUpdateok")<0)
out.print("msg="+st);
else
{
updatesql="updateguestbooksetanswer_num=answer_num+1"+l
where;
//增添复兴人数统计
try{
st=testInq.executeUpdate(updatesql);
if(st.indexOf("executeUpdateok")<0)
out.print("msg="+st);
}catch(Exceptione){}
}
}catch(Exceptione){out.print("留言堕落:"+e);}
}catch(Exceptione){}
%>
<%
//考证留言输出项正当性的javascript
Stringljs="<SCRIPTlanguage=JavaScript>
"+
"<!--
"+
"functionValidInput()
"+
"{if(document.sign.lw_author.value=="")
"+
"{alert("请填写您的台甫。");
"+
"document.sign.lw_author.focus();
"+
"returnfalse;}
"+
"if(document.sign.lw_title.value=="")
"+
"{alert("请填写留言主题。");
"+
"document.sign.lw_title.focus();
"+
"returnfalse;}
"+
"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();
"+
"returnfalse;
"+
"}
"+
"}
"+
"returntrue;
"+
"}
"+
"functionValidSearch()
"+
"{if(document.frmsearch.findstr.value=="")
"+
"{alert("不克不及搜刮空串!");
"+
"document.frmsearch.findstr.focus();
"+
"returnfalse;}
"+
"}
"+
"//-->
"+
"</SCRIPT>";
out.print(ljs);
%>
<%
//显现比来工夫宣布的一页留言
countsql="selectcount(lw_title)fromguestbook"+lwhere;
inqsql="selectlw_title,lw_author,lw_time,lw_content,author_ip,"+
"author_emailfromguestbook"+lwhere+"orderbylw_timedesc
";
updatesql="updateguestbooksetclick_num=click_num+1"+lwhere;
//增添扫瞄人数统计
try{
st=testInq.executeUpdate(updatesql);
if(st.indexOf("executeUpdateok")<0)
out.print("msg="+st);
}catch(Exceptione){}
//out.print(inqsql);
if(pages>0)
{
try{
try{
ResultSetrcount=testInq.executeQuery(countsql);
if(rcount.next())
{
count=rcount.getInt(1);
}
rcount.close();
}catch(Exceptionel1){out.println("countrecorderror
:"+el1+"
");
out.println(countsql);
}
totalpages=(int)(count/pagesize);
if(count>totalpages*pagesize)totalpages++;
st=""+
"<TABLEalign=centerborder=0cellPadding=0cellSpacing=
0width="95%">"+
"<TBODY><TR><TDalign=middlebgColor=#97baddwidth="1
00%"><FONTcolor=#ff0000>"+
"共"+totalpages+"页,"+count+"
条."+"以后页:"+pages+
"</FONT></TD></TR></TBODY></TABLE><BR>";
out.print(st);
//out.print("共"+totalpages+"页,"+
count+"条."+"以后页:"+pages+"
");
st="<center>"+
"<TABLEborder=0cellPadding=2cellSpacing=1width="95%">"+
"<TBODY>"+
"<TR>"+
"<TDalign=middlebgColor=#6699ccwidth="55%"><FONT"+
"color=#ffffff>留言主题</FONT></TD>"+
"<TDalign=middlebgColor=#6699ccwidth=50><FONT"+
"color=#ffffff>回应数</FONT></TD>"+
"<TDalign=middlebgColor=#6699ccwidth=40><FONT"+
"color=#ffffff>点击数</FONT></TD>"+
"<TDalign=middlebgColor=#6699ccwidth=100><FONT"+
"color=#ffffff>作者名</FONT></TD>"+
"<TDalign=middlebgColor=#6699ccwidth=140><FONT"+
"color=#ffffff>宣布/回应工夫</FONT></TD></TR>";
//out.print(st);
if(count>0)
{
ResultSetrs=testInq.executeQuery(inqsql);
ResultSetMetaDatametaData=rs.getMetaData();
inti;
//跳过pages-1页,使cursor指向pages并筹办显现
for(i=1;i<=(pages-1)*pagesize;i++)rs.next();
//显现第pages页入手下手
st="<CENTER><TABLEborder=0cellSpacing=1width="95%"
><TBODY>";
out.print(st);
Stringlinestr="";
for(i=1;i<=pagesize;i++)
if(rs.next())
{
lw_title=rs.getString("lw_title");
lw_author=rs.getString("lw_author");
lw_time=rs.getString("lw_time");
lw_content=rs.getString("lw_content");
author_ip=rs.getString("author_ip");
author_email=rs.getString("author_email");
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);
try{lw_content=testInq.addBr(testInq.removeComment(lw_co
ntent));}catch(Exceptione){}
linestr=""+
"<TRbgColor=#bed9fc>"+
"<TDalign=leftwidth="75%"><FONT"+
"color=#0000cd>留言主题:</FONT><STRONG>"
+lw_title+"</STRONG></TD>"+
"<TDalign=leftwidth="25%"><FONTcolor=
#0000cd>留言工夫:</FONT>"+st+"</TD></TR>"+
"<TRbgColor=#e7f1fe>"+
"<TDcolSpan=2"+
"width="700"wrap=yes><BR>"+lw_content+"
<BR>
</TD></TR>"+
"<TRbgColor=#bed9fc>"+
"<TDalign=rightcolSpan=2width="100%">
<FONT"+
"color=#0000cd>作者:</FONT>"+lw_author+"
<FONT"+
"color=#0000cd>来历:</FONT>"+author_ip+"
</TD></TR>";
out.println(linestr);
}
rs.close();
//显现第pages页停止
st="</TBODY></TABLE></CENTER></DIV><BR>"+
"<CENTER><A"+
"href="guestbook.jsp"><FONT"+
"color=blueface=楷体_GB2312size=4>前往留言板
首页</FONT></A></CENTER><BR>"+
"<HRalign=centernoShadeSIZE=1width="95%"
>";
out.print(st);
intiFirst=1,iLast=totalpages,iPre,iNext;
if(pages<=1)iPre=1;
elseiPre=pages-1;
if(pages>=totalpages)iNext=totalpages;
elseiNext=pages+1;
intn=(int)(count/pagesize);
if(n*pagesize<count)n++;
if(n>1)
{
//for(i=1;i<=n;i++)out.print("<ahref=inquire.jsp?pages=
"+i+">"+i+"</a>");
//out.print("<HRalign=centernoShadeSIZE=1width="95%
">");
Stringlt1="前往主页",lt2="第一页",lt3="上一页",lt4="下一
页",lt5="最初一页",lt6="";
lt6="<ahref=http://www.zj.hn.cn>"+lt1+"</
a>"+
lurlt+"pages="+iFirst+"><FONTcolor=red>"+lt2+"&nbs
p;</a>"+
lurlt+"pages="+iPre+"><FONTcolor=red>"+lt3+"
</a>"+
lurlt+"pages="+iNext+"><FONTcolor=red>"+lt4+"
;</a>"+
lurlt+"pages="+iLast+"><FONTcolor=red>"+lt5+"
;</a>";
st=""+
"<TABLEalign=centerborder=0cellPadding=0cellSpacing=
0width="95%">"+
"<TBODY><TR><TDalign=middlebgColor=#97baddwidth="1
00%"><FONTcolor=#ff0000>"+
lt6+
"</FONT></TD></TR></TBODY></TABLE><BR>";
out.print(st);
}
}
}catch(Exceptione){out.println("error:"+e);}
}
%>
<%
//留言板界面尾部
Stringlbottom="";
lbottom=lbottom+
"<center>
"+
"<FORMaction=reply.jspmethod=postname=sign>
"+
"<INPUTname=lw_class1type=hiddenvalue=cnzjj_gt>
"+
"<INPUTname=lw_class2type=hiddenvalue="+lw_class2+">
"
+
"<INPUTname=pagestype=hiddenvalue=1>
"+
"<INPUTname=zt_timetype=hiddenvalue="+zt_time+">
"+
"<INPUTname=zt_authortype=hiddenvalue="+zt_author+">
"
+
"<TABLEbgColor=#d5e8fdborder=0cellSpacing=1width="95%">
"+
"<TBODY>
"+
"<TR>
"+
"<TDalign=middlebgColor=#e6e6facolSpan=2noWrap><STRONG><FONT
color=blue
"+
"face=楷体_GB2312size=5>发表意见</FONT></STRONG>&nbs
p;[加*的内容必需填写]</TD></TR>
"+
"<TR>
"+
"<TDnoWrapwidth="45%">
"+
"<DIValign=left>
"+
"<TABLEbgColor=#d5e8fdborder=0cellSpacing=1width="100%">
"+
"<TBODY>
"+
"<TR>
"+
"<TDnoWrapwidth="100%">*留言主题:<INPUTmaxLength=40n
ame=lw_title
"+
"size=36></TD></TR>
"+
"<TR>
"+
"<TDnoWrapwidth="100%">*网上台甫:<INPUTmaxLength=18n
ame=lw_author
"+
"size=36></TD></TR>
"+
"<TR>
"+
"<TDnoWrapwidth="100%">主页题目:<INPUTmaxLength
=40name=pagetitle
"+
"size=36></TD></TR>
"+
"<TR>
"+
"<TDnoWrapwidth="100%">主页地点:<INPUTmaxLength
=255name=author_http
"+
"size=36></TD></TR>
"+
"<TR>
"+
"<TDnoWrapwidth="100%">*电子邮件:<INPUTmaxLength=40n
ame=author_email
"+
"size=36></TD></TR></TBODY></TABLE></DIV></TD>
"+
"<TDnoWrapvAlign=topwidth="55%">
"+
"<DIValign=left>
"+
"<TABLEbgColor=#b6d7fcborder=0cellSpacing=1width="100%">
"+
"<TBODY>
"+
"<TR>
"+
"<TDwidth="100%">请鄙人面填写你的留言:</TD></TR>
"+
"<TR>
"+
"<TDwidth="100%"><TEXTAREAcols=50name=lw_contentrows=
7></TEXTAREA></TD></TR></TBODY></TABLE></DIV></TD></TR>
"+
"<TR>
"+
"<TDbgColor=#fbf7eacolSpan=2noWrap>心情
"+
"<INPUTname=giffacetype=radiovalue=1checked><I
NPUT
"+
"name=giffacetype=radiovalue=2><INPUTname=giffacetype=radiovalue=3
><I
NPUT
"+
"name=giffacetype=radiovalue=4><INPUTname=giffacetype=radiovalue=5
><I
NPUT
"+
"name=giffacetype=radiovalue=6><INPUTname=giffacetype=radiovalue=7
><I
NPUT
"+
"name=giffacetype=radiovalue=8><INPUTname=giffacetype=radiovalue=9
><I
NPUT
"+
"name=giffacetype=radiovalue=10><INPUTname=giffacetype=radiovalue=
11><
INPUT
"+
"name=giffacetype=radiovalue=12>
"+
"<INPUT
"+
"name=giffacetype=radiovalue=13>
"+
"<INPUT
"+
"name=giffacetype=radiovalue=14>
"+
"<INPUT
"+
"name=giffacetype=radiovalue=15>
"+
"<INPUT
"+
"name=giffacetype=radiovalue=16></TD>
"+
"</TR>
"+
"<TR>
"+
"<TDalign=middlecolSpan=2noWrap><INPUTname=cmdGOonclick="re
turnValidInput()"type=submitvalue="提交">
"+
"<INPUTname=cmdPrevonclick="returnValidInput()"type=submitvalu
e="预览">
"+
"<INPUTname=cmdCanceltype=resetvalue="重写"><INPU
Tname=cmdBackonclick=javascript:history.go(-1)type=buttonvalue="返
回">
"+
"</TD></TR></TBODY></TABLE></FORM></CENTER></DIV>";
out.print(lbottom);
%>
</body></html>
你希望java的IDE整合。这个是没有必要的,重要的是你理解java有多深以及怎么组织你的代码,即使没有IDE,代码照样能够编译运行的。 |
|