<dependency>
<groupId>eu.bitwalker</groupId>
<artifactId>UserAgentUtils</artifactId>
<version>1.21</version>
</dependency>
import eu.bitwalker.useragentutils.Browser;
import eu.bitwalker.useragentutils.UserAgent;
import eu.bitwalker.useragentutils.Version;
Browser browser = UserAgent.parseUserAgentString(request.getHeader("User-Agent")).getBrowser();
Version version = browser.getVersion(request.getHeader("User-Agent"));
logger.info("获取浏览器信息:{},获取浏览器信息:{}",browser.getName(), version.getVersion());
同时发现一篇比较详细的文章,这里就不重复造轮子了。具体细节可以查看这位博主的文章
程序媛小雪
原文地址:https://blog.csdn.net/weixin_37264997/article/details/88993729