browser version detection from server side with java

后端 未结 5 1087
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-02 16:58

I saw many posts related to the browser detection, User agent detection etc...I want to detect the version from server side and send appropriate data based on that.

相关标签:
5条回答
  • 2021-01-02 17:18

    Take a look at user-agent-utils.

    0 讨论(0)
  • 2021-01-02 17:27

    Check the headers in the HTTP servlet request - they'll tell you. Check the "User-Agent" header.

    0 讨论(0)
  • 2021-01-02 17:31

    Here is the code explaining how to do it using user-agent-utils:

    String userAgent = req.getHeader("user-agent");
    UserAgent ua = UserAgent.parseUserAgentString(userAgent);
    Version browserVersion = ua.getBrowserVersion();
    String browserName = ua.getBrowser().toString();
    int majVersion = Integer.parseInt(browserVersion.getMajorVersion());
    
    0 讨论(0)
  • 2021-01-02 17:35

    Use Spring Mobile Device Module?

    This can use either the LiteDeviceResolver or the WurflDeviceResolver.

    0 讨论(0)
  • 2021-01-02 17:38

    I recommend UA Detector at uadetector.sourceforge.net

    0 讨论(0)
提交回复
热议问题