response

a.jsp
.............................................................................................................................
<%@ 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 bgcolor = "#912123"> <font size = 5>
<FORM action = "b.jsp" method = post name = form>
<input type = "text" name = "name">
<input type = "submit" name = "submit" value = "提交">
</FORM>
</font>
</body>
</html>
..............................................................................................................................
b.jsp

<%@ 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 bgcolor="#176698">  <font size=5>

<%   String str = request.getParameter("name");  

 byte b[] = str.getBytes("ISO-8859-1");   

str = new String(b, "UTF-8");  

%>  

<P>添加<%=str %>成功,页面将在5s后跳转</P>  

<% response.setHeader("refresh","5;url=a.jsp?send="+str); %>  

<p>否则点击<a href="a.jsp?send=<%=str%>">此处跳转</a></p>  

 </font>

</body>

</html>

 
posted @ 2013-08-20 10:09  最是那一杯红酒  阅读(146)  评论(0编辑  收藏  举报