is Ajax Request HttpServletRequest - Java javax.servlet.http

Java examples for javax.servlet.http:HttpServletRequest

Description

is Ajax Request HttpServletRequest

Demo Code


import javax.servlet.http.HttpServletRequest;

public class Main{
    /* w w  w .  j  a v  a2  s .co m*/
    public static boolean isAjaxRequest(HttpServletRequest request) {
        String requestType = request.getHeader("X-Requested-With");
        if (null != requestType)
            return true;
        else
            return false;
    }
}

Related Tutorials