RequestContext rCtx = RequestContext.getCurrentInstance();
FacesContext fctx=FacesContext.getCurrentInstance();
Agent agnt = rCtx.getAgent();
Map reqHeader=
FacesContext.getCurrentInstance().getExternalContext().getRequestHeaderMap();
FacesContext fctx=FacesContext.getCurrentInstance();
Agent agnt = rCtx.getAgent();
String browser = agnt.getAgentName();
- //Get user's Browser's engine name
2. //Get user's Browser's engine versionString browser_version = agnt.getAgentVersion();
3. //Get user's IP addressString userIpAddress = ((HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest()).getRemoteAddr();
4. //Get user's PlatformString platform = agnt.getPlatformName();
5. //Get user's Platform's versionString platformVersion = agnt.getPlatformVersion();
Map reqHeader=
FacesContext.getCurrentInstance().getExternalContext().getRequestHeaderMap();
6. // Get the User agentSystem.out.println(reqHeader.get("User-Agent"));