「Java入門」 HttpServletパラメータを取得するコード

javaコード
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet(“/StudentRequest")
public class StudentRequest extends HttpServlet {
private static final long serialVersionUID = 1L;

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding(“UTF-8");

String userid = request.getParameter(“userid");
String sex = request.getParameter(“sex");
String hometown = request.getParameter(“hometown");
String salary= request.getParameter(“salary");
}

}

Java

Posted by arkgame