javaservlet
Posted 哈哈呵
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javaservlet相关的知识,希望对你有一定的参考价值。
packet servlet; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class CheckParamServlet extends HttpServlet{ public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String name = request.getParameter("name"); String pass = request.getParameter("pass"); response.setContentType("text/html;charset=gb2312"); PrintWriter out = response.getWriter(); out.println(""); out.println("你的用户名为:"+name+"
"); out.println("你的口令为:"+pass+"
"); out.println(""); } public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request,response); } }以上是关于javaservlet的主要内容,如果未能解决你的问题,请参考以下文章