boolean isFirefox(HttpServeletRequest req) { final String agent = req.getHeader("User-Agent"); if (agent == null) return false; return agent.indexOf("Firefox") >= 0; }
Programming Tips - Java: In a Java Servlet, how can I check if the browser is Firefox?
Date: 2012oct12
Language: Java
Q. Java: In a Java Servlet, how can I check if the browser is Firefox?
A. Here's a method that does that: