Request Handers
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36
java:
//获取浏览器信息
Enumeration eua = ServletUtils.getRequest().getHeaders("User-Agent");
String sua = (String) eua.nextElement();
//转成UserAgent对象
UserAgent userAgent = UserAgent.parseUserAgentString(sua);
// 获取客户端操作系统
String os = userAgent.getOperatingSystem().getName();
// 获取客户端浏览器
String browser = userAgent.getBrowser().getName();
结果
sua = “JAVA/14.0.2”不是我要的