使用的开发工具是eclipse,项目的目录结构如下:我在“biaodan.html”中写了一个表单,代码如下: <!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>form</title> <link rel="stylesheet" type="text/css" href="../css/biaodan_css.css"/></head> <body> <div id="bod"> <br /> <div id="logo"> <h1>我们请求您留下自己的联系方式</h1> </div> <div id="img"> <img src="../img/images/girl.png"/> </div> <div id="content"> <div id="fm"> <form action=t58.jsp method="post"> <span id="font"> 请输入您的QQ: </span> <input type="text" name="qq" id="qq" value="" /> <input type="submit" value="提交"/> </form> </div> </div> </div> </body></html>我在“t58.jsp”中用了一个request的方法,代码如下:<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%><!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=ISO-8859-1"> <title>Insert title here</title> </head> <body> <% String qq = request.getParameter("qq"); %> 你输入的QQ是: <% out.print(qq); %> </body> </html>
添加回答
举报
0/150
提交
取消