|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
最初被命名为Oak,目标设定在家用电器等小型系统的编程语言,来解决诸如电视机、电话、闹钟、烤面包机等家用电器的控制和通讯问题。js|中文<html>
<head>
<title>MyFirstJspGuestBook</title>
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312">
</head>
<bodybgcolor="#CCCCFF"vlink="#000000"alink="#666666">
<divalign="center">
<p><fontsize="7"><b><fontsize="+6">JspGuestBook</font></b></font></p>
<formmethod="post"action="index.jsp">
<tablewidth="75%"align="center"border=1>
<tr>
<tdwidth="30%">
<divalign="right">Name:</div>
</td>
<tdwidth="70%">
<inputtype="text"name="name">
</td>
</tr>
<tr>
<tdwidth="30%">
<divalign="right">E-mail:</div>
</td>
<tdwidth="70%">
<inputtype="text"name="email">
</td>
</tr>
<tr>
<tdwidth="30%">
<divalign="right">SiteUrl:</div>
</td>
<tdwidth="70%">
<inputtype="text"name="url"value="http://">
</td>
</tr>
<tr>
<tdwidth="30%">
<p>Whatdoyouwantto</p>
<p>say?</p>
</td>
<tdwidth="70%">
<textareaname="body"rows="5"cols="30"></textarea>
</td>
</tr>
<tr>
<tdwidth="30%"></td>
<tdwidth="70%"></td>
</tr>
<tr>
<tdwidth="30%"></td>
<tdwidth="70%">
<tablewidth="75%">
<tr>
<td>
<inputtype="submit"name="send"value="Send">
</td>
<td>
<inputtype="reset"name="reset"value="Reset">
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<hr>
<%@pagecontentType="text/html;charset=gb2312"%>
<%@pagelanguage="java"import="java.sql.*"%>
<jsp:useBeanid="sqlbean"scope="page"class="jsp.sql_data"/>
<%!Stringname,email,url,body,sql;%>
<%!intid;%>
<%
name=null;
name=request.getParameter("name");
//name=newString(request.getParameter("name").getBytes("8859_1"));
%>
<%=name%>
<%
if(name!=null&&name!="")
{
name=newString(request.getParameter("name").getBytes("8859_1"));
email=newString(request.getParameter("email").getBytes("8859_1"));
url=newString(request.getParameter("url").getBytes("8859_1"));
body=newString(request.getParameter("body").getBytes("8859_1"));
ResultSetRSet=sqlbean.executeQuery("SELECT*FROMguestbook");
RSet.last();
id=RSet.getRow()+1;
RSet.close();
sqlbean.sqlclose();
sql="insertintoguestbook(Recordid,Name,Email,Url,Body)values("+id+","+name+","+email+","+url+","+body+")";
sqlbean.executeQuery(sql);
sqlbean.sqlclose();
}else{
out.print("<b><fontcolor=red>Pleaseenteryourname,emailandbody!!!</font></b>");
}
%>
<p><fontsize="4"><b><ahref="./index.jsp#see">SeeMyGuestbook</a></b></font></p>
<p></p>
<%
ResultSetRS=sqlbean.executeQuery("SELECT*FROMguestbookORDERBYRecordIDDESC");
while(RS.next()){
name=newString(RS.getString("Name").getBytes("8859_1"));
email=newString(RS.getString("Email").getBytes("8859_1"));
url=newString(RS.getString("Url").getBytes("8859_1"));
body=newString(RS.getString("Body").getBytes("8859_1"));
%>
<tableborder=1width=80%>
<tr>
<tdwidth=30%>Name:</td><tdwidth=70%><%=name%>
</tr>
<tr>
<tdwidth=30%>Email:</td><tdwidth=70%><ahref="mailto:<%=email%>"><%=email%></a></td>
</tr>
<tr>
<tdwidth=30%>SiteUrl:</td><tdwidth=70%><ahref="<%=url%>"><%=url%></a></td>
</tr>
<tr>
<tdwidth=30%>Body:</td><tdwidth=70%><%=body%></td>
</tr>
</table>
<hr>
<%
}
RS.close();
sqlbean.sqlclose();
%>
</div>
</body>
</html>
为什么外国人还要写那些框架进行代码封装,他们不就是为了别人使用时可以更简单么!如果要达到一个企业级项目的不用框架是很难的。小一些的项目还行,大的光是MVC模式的设计的编码量就够大的了。还有性能方面,单轮windows,这个工具是微软写的,。 |
|