抽取servlet后继承httpservlet重写service,还怎么判断用get还是post方法处理请求?
回答
小跑的蜗牛回答
String method = request.getMethod();
if (method == METHOD_POST) {
doPost(req, resp);
} else {
doGet(req, resp);
}
}
通过这个可以判断, 另外pc端视频旁边有在线答疑, 可以及时解决你的问题.

(0)
相似问题