当前位置:编程学习 > 网站相关 >>

Struts2判断GET/POST请求

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请求");

}

补充:Web开发 , 其他 ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,