日期:2014-05-17 浏览次数:20762 次
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String te=request.getParameter("te");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<table> <TR><td>我是中文 </td></TR>
</table><br>-----------<%=te%>
<form action="Testservlet" method="get">
<table>
<tr>
<td>
<input name="te" type="text" value=""/>
<input name="su" type="submit" value="提交"/>
</td>
</tr>
</table>
</form>
</body>
<table>
<tr>
<td>
___${te}
</td>
</tr>
</table>
</html>
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
PrintWriter out = response.getWriter();
request.setCharacterEncoding("UTF-8");
// response.setCharacterEncoding("UTF-8");
String te=request.getParameter("te");
// te=new String(te.getBytes("ISO-8859-1"),"GBK");
System.out.println(te+"/////");
request.setAttribute("te",te);
request.getRequestDispatcher("/index.jsp").forward(request, response);
}