码迷,mamicode.com
首页 > Web开发 > 详细

jsp留言板

时间:2016-06-26 12:45:47      阅读:259      评论:0      收藏:0      [点我收藏+]

标签:

1、留言板代码

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<form action="lianxi2.jsp" method="post">
<table width="500" height="400" border="1" cellpadding="0" cellspacing="0"style=""font:9pt;"
bordercolordark="#666666" bordercolorlight="#FFFFFF" bordercolor="#FFFFFF">
<tr height="40" align="center"><td>留言簿</td></tr>
<tr ><td>
<textarea name="name" rows="25" cols="80"></textarea>
</td></tr>
<tr>
<td align="center" coslspan="2">
<input type="submit" value="提交留言">
</td>
</tr>
</table>

</form>
</body>
</html>

 运行及输入留言:

技术分享

2、留言转码并输出代码

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>

<table width="500" height="400" border="1" cellpadding="0" cellspacing="0"style=""font:9pt;"
bordercolordark="#666666" bordercolorlight="#FFFFFF" bordercolor="#FFFFFF">
<tr height="40" align="center"><td>感谢您的留言</td></tr>
<tr align="center"><td>
<% 
String name=new String(request.getParameter("name").getBytes("ISO-8859-1"),"UTF-8");
out.print(name);
%>
</td></tr>

</table>

</body>
</html>

 运行结果:

技术分享

 

jsp留言板

标签:

原文地址:http://www.cnblogs.com/jakeasd/p/5617600.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!