注册登录

packagecom.xiaocui.controller;

importjava.io.IOException;

importjava.util.Arrays;

importjavax.servlet.ServletException;

importjavax.servlet.annotation.WebServlet;

importjavax.servlet.http.HttpServlet;

importjavax.servlet.http.HttpServletRequest;

importjavax.servlet.http.HttpServletResponse;


/**

 * Request

 */

@WebServlet("/RequestDemo1")

publicclassRequestDemo1extendsHttpServlet {

protectedvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse) throwsServletException, IOException {

   Stringusername = request.getParameter("username");

   Stringpassword = request.getParameter("password");

   Stringsex = request.getParameter("sex");

   Stringcity = request.getParameter("city");

String[]info = request.getParameterValues("info");


System.out.println("用户名" + username);

System.out.println("密码" + password);

System.out.println("性别" + sex);

System.out.println("自我介绍" + info);

 }

protectedvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse) throwsServletException, IOException {

doGet(request, response);

 }

}

"UTF-8">

Insert title</p> <p>here

网页登录

"/RequestDemo1">

   用户名:"text"name="username">

  密码:"password"name="password">

  性别:"radio"name="sex"value="man">男

"radio"name="sex"value="woman">女

个人介绍:"3"cols="8"name="info">

"submit"value="提交">

    是否确认登录?"checkbox"name=""id=""value=""/>

 注册:"submit"id=""value="注册"/>

你可能感兴趣的:(注册登录)