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;
/**
Servlet implementation class course
/
@WebServlet("/course")
public class course extends HttpServlet {
private static final long serialVersionUID = 1L;/**
- @see HttpServlet#HttpServlet()
- /
public course() {
super();
// TODO Auto-generated constructor stub
}
/**
- @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
- /
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost (request, response);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{ request.setCharacterEncoding("utf-8");String mingzi= request.getParameter("mingzi"); String xuehao= request.getParameter("xuehao"); String mima= request.getParameter("mima"); String xingbei= request.getParameter("xingbei"); String department= request.getParameter("department"); String[] ch1= request.getParameterValues("ch1"); String email= request.getParameter("email"); String memo= request.getParameter("beizhu"); response.setContentType("text/html;charset=utf-8"); response.getWriter().write("
姓名: "
+mingzi+""); response.getWriter().write("学号: "
+xuehao+""); response.getWriter().write("密码: "
+mima+""); response.getWriter().write("性别: "
+xingbei+""); response.getWriter().write("系部: "
+department+""); response.getWriter().write("所选课程: "
+ch1+""); response.getWriter().write("邮箱: "
+email+""); response.getWriter().write("备注: "
+memo+""); for(int i=0;ch1!=null && i<ch1.length;i++){ response.getWriter().write("所选课程"
+ch1[i]+"