0
would like to know how to print the browser the client is using and if OS using jsp. Some people suggested using ${header["user-agent"]}
however, this command returns various information and I would like only the browser and the OS.
0
would like to know how to print the browser the client is using and if OS using jsp. Some people suggested using ${header["user-agent"]}
however, this command returns various information and I would like only the browser and the OS.
0
Take a look at user-agent-utils, with this lib you can easily extract the information you need, for example:
String userAgentStr = request.getHeader("User-Agent");
UserAgent userAgent = UserAgent.parseUserAgentString(userAgentStr);
And in the Useragent object you have methods like getOperatingSystem()
and getBrowser()
. Javadoc here.
Browser other questions tagged java web-application jsp request
You are not signed in. Login or sign up in order to post.