日期:2014-05-17 浏览次数:20798 次
<%@ page import="java.sql.*" %> <%@ page import="java.lang.*" %> <%@page contentType="text/html" pageEncoding="GB2312"%> <!DOCTYPE html> <BODY> <P>输入姓名: <FORM action="Count" method="get"> <INPUT type=text name=number> <INPUT type=submit value="提交"> <% String rea1 = request.getPatameter("read"); out.print(read1); %> </FORM> </body>
public class Count extends HttpServlet { public void service(HttpServletRequest req,HttpServletResponse res)throws IOException { String read = "darc"; PrintWriter out = res.getWriter(); res.setContentType("text/html;charset=GB2312"); String number = req.getParameter("number"); req.setCharacterEncoding("gbk"); out.print("<BR>"+"hello"+number); } }