jsp中验证用户是否以post方式提交
时间:2014-04-29 13:34:20
收藏:0
阅读:350
在项目中有时需要验证用户是否以post方式提交。下面是验证源码:
public boolean checkMethod(String method) {
if (request.getMethod().equalsIgnoreCase(method)) {
return true;
}
else {
return false;
}
}
调用方式 checkMethod("post").如果以post方式提交为true,否则为FALSE。
评论(0)