Get USER AGENT from HttpServletRequest - Java Network

Java examples for Network:User Agent

Description

Get USER AGENT from HttpServletRequest

Demo Code


import javax.servlet.http.HttpServletRequest;

public class Main{
    /*from ww w .j  ava 2  s.  c o  m*/
    public static String getAgent(HttpServletRequest request) {
        return request.getHeader("USER-AGENT");
    }
}

Related Tutorials