public class AddDeviceServlet extends HttpServlet {private static final long serialVersionUID = 1L;@Overrideprotected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {doPost(request, response);}public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {String licensePlate = Parameter("licensePlate"); //获取车牌号String tel = Parameter("tel"); //获取手机号MyDevice device = new MyDevice(licensePlate, tel); //将请求参数封装成一个对象save(device); //保存数据Writer()print(true); //向客户端返回一个成功标识setContentType("text/html;charset=utf-8");setCharacterEncoding("utf-8");Writer()println("你的车牌号: " + licensePlate); //向客户端返回一个成功标识Writer()println("你的手机号: " + tel); //向客户端返回一个成功标识}