Struts2判断GET/POST请求

 

String method = ServletActionContext.getRequest().getMethod();
System.out.println(method);

if(method.equals(“POST”){

System.out.println(“POST请求”);

}else{

System.out.println(“GET请求”);

}

posted on 2013-01-15 13:09  Java学习者  阅读(371)  评论(0)    收藏  举报