Package org.beangle.web

Examples of org.beangle.web.Useragent


    //String remark=head.substring(start, end);
    String[] headers=StrUtils.split(head.toString());
    String browser=headers[headers.length-1];
    String os=headers[headers.length-2];
    //Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12) Gecko/20101027 Fedora/3.6.12-1.fc14 Firefox/3.6.12
    Useragent agent = new Useragent();
    agent.setIp(getIpAddr(request));
    agent.setOs(StringUtils.substringBefore(os, "/"));
    agent.setOsVersion(StringUtils.substringAfterLast(os, "."));
    agent.setAgent(StringUtils.substringBefore(browser, "/"));
    agent.setAgentVersion(StringUtils.substringAfter(browser, "/"));
    return agent;
  }
View Full Code Here

TOP

Related Classes of org.beangle.web.Useragent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.