MCPcopy Create free account
hub / github.com/diyhi/bbs / submitDataMode

Method submitDataMode

src/main/java/cms/utils/WebUtil.java:294–308  ·  view source on GitHub ↗

提交数据方式 @param request 请求信息 @return true: Ajax方式 false: Form表单提交方式

(HttpServletRequest request)

Source from the content-addressed store, hash-verified

292 * @return true: Ajax方式 false: Form表单提交方式
293 */
294 public static boolean submitDataMode(HttpServletRequest request){
295 boolean isAjax = false;//是否以Ajax方式提交数据
296 //读取报文
297 String requestType = request.getHeader("X-Requested-With");
298
299 if(requestType != null && !requestType.trim().isEmpty()){//重复添加时会有多个值
300 String[] requestType_arr = requestType.split(",");
301 for(String value : requestType_arr){
302 if(value != null && "XMLHttpRequest".equalsIgnoreCase(value.trim())){
303 return true;
304 }
305 }
306 }
307 return isAjax;
308 }
309
310 /**
311 * 向页面输出数据

Callers 1

fileDownloadMethod · 0.95

Calls 1

isEmptyMethod · 0.45

Tested by

no test coverage detected