欢迎光临
我们一直在努力

这是一个用jsp代码出现好多错误--编一个论坛的页面-JSP教程,Jsp/Servlet

建站超值云服务器,限时71元/月

<html>
<head>
<title>my  first jsp guestbook</title>
<meta http-equiv=”content-type”content=”text/html; charset=gb2312″>
</head>
<body  bgcolor=”#ccccff” vlink=”#000000″ alink=”#666666″>

<div align=”center”>
<p><font size=”7″><b><font size=” +6″>jsp aguestbook</font></b></font></p>

<form method=”post” action=”index1.jsp”>
<table width=”75%” align=”center” border=1>
<tr>
<td width=”30%”>
<div align=”right” name:</div>
</td>
<td width=”70″>
<input type=”text” name=”name”>00000
</td>
</tr>
<tr>
<td width=”30%”>
<div align=”right”> e-mail:</div>
</td>
<td width=”70%”>
<input type=”text” name=”email”>
</td>
</tr>
<tr>
<td width=”30%”>
<div align=”right”>site url:</div>
</td>
<td width=”70%”>
<input type=”text” name=”url” value=”http://”>
</td>
</tr>
<tr>
<td width=”30%”>
<p>what do you want to</p>
<p>say?</p>
</td>
<td width=”70%”>
<textarea  name=”body” rows=”5″ cols=”30″></textarea>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td width=”70%”>&nbsp;</td>
<td width=”70%”>
<table width=”75%”>
<tr>
<td>
<input type=”submit” name=”send” value=”send”>
</td>
<td>
<input type=”reset” name=”reset” value=”reset”>
</td>
</tr>
</table>
</td>
</tr>
</table></form>

<hr>
<%@ page contenttype=”text/html;charset=gb2312″%>
<%@ page language=”java” import=”java.sq1.*”%>
<jsp:usebean id=”sq1bean” scope=”page” class=”jsp.mysq1″ />
<%! string name,email,url,body,sq1; %>
<%! int id; %>

<%
name = null;
name = request.getparameter(“name”);
%>
<%
if (name != null&&name !=” “)
{
 name = new string(request.getparamer(“name”).getbytes(“8859_1”));
 email = new steing(request.getparamer(“email”).getbytes(“8859_1”));
 url = new string(request.getparamer(“url”).getbytes(“8859_1”));
 body=newsteing(request.getparamer(“body”).getbytes(“8859_1”));sq1=”insertintoguestbook(name,email,url,body)
 values(“+name+”,”+email+”,”=url+”,”+body+”)”;
 sq1bean.executery(sq1);
 sq1bean.sq1close();
 
 }else{
 out.print(“<b><font color=red>please enter your name,email and body!!!</font>
 </b>”);
      }
      %>
   <p><font size=”4″><b><a  href=”./index.jsp#see”>see my guestbook</a></b>
   </font></p>
   <p>&nbsp;</p>
   <%
 resultset rs = sq1bean.executequery(“select * frm guestbook order by recordid
desc”);

      while (rs.next()){
   name =new string (rs.getstring(“name”).getbytes(“8859_1”));
   email =new string (rs.getstring(“email”).getbytes(“8859_1”));
   uel =new string (rs.getstring(“ual”).getbytes(“8859_1”));
  body =new string (rs.getstring(“body”).getbytes(“8859_1”));
  %>
  <table border=1>
  <tr>
  <td>name:</td><td><%= name %>
  </td>
  </tr>
  <tr>
  <td>email:</td><td><a href=”mailto:<%= email %>”><%= email %></a></td>
  </tr>
  <tr>
  <td>siteurl;</td><td><a href=”<%= url %>”><%= url %></a></td>
  </tr>
  <tr>
  <td>body:</td><td><%= body %></td>
  </tr>
  </table>
     <hr>
  <%
  }
  rs.close();
  sq1bean.sq1close();
 
  %>
 
 
 
  </div>
</body>
</html>

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 这是一个用jsp代码出现好多错误--编一个论坛的页面-JSP教程,Jsp/Servlet
分享到: 更多 (0)