private static String getDeviceType(HttpServletRequest request) { final String agt = request.getHeader("user-agent"); if (agt != null && agt.length() > 0) { try { return Devices.getDeviceByClient(agt).getType(); } catch (Throwable ex) { log.warning("Unknown device for " + agt); } } return "ajax"; }