Form的用法
提交页面:
<!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 id="login" method="post" action="AcceptForm.jsp"> 用户名:<input name="username" type="text"><br> 密码:<input type="password" name="passwd"><br> <input type="submit" value="提交"> </form> </body> </html>
接收页面:
<%@ page language="java" contentType="text/html; charset=GBK" pageEncoding="GBK"%> <!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=GBK"> <title>Insert title here</title> </head> <body> 用户名:<%=request.getParameter("username")%><br> 密码:<%=request.getParameter("passwd") %> </body> </html>