标签:
/** * 判断请求是否手机端 * @param req * @return */ public static boolean isMobile(HttpServletRequest req) { UserAgent ua = UserAgent.parseUserAgentString(req.getHeader("User-Agent")); OperatingSystem os = ua.getOperatingSystem(); if(DeviceType.MOBILE.equals(os.getDeviceType())) { return true; } return false; }
标签:
原文地址:http://www.cnblogs.com/hwaggLee/p/4846289.html