使用String str=request.getParameter(“stuname”);接受提交内容
代码块
<!--表单-->
<%@ page language="java" contentType="text/html; charset=gb2312"
pageEncoding="gb2312" %>
<!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="TJ.jsp" method="post">
<input name="stuname" type="text" value="1qwe">
<input type="submit" value="注册">
</form>
</body>
</html>
>>> message = '''interpreter
... prompt'''
<!--接收提交内容-->
<%@ page language="java" contentType="text/html; charset=gb2312"
pageEncoding="gb2312"%>
<!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>
<%
String str=request.getParameter("stuname");
str=new String(str.getBytes("ISO-8859-1"),"gb2312");
out.print(str);
%>
</body>
</html>