Retrieve User-Agent HTTP Header

Hi,

Is there a way to retrieve the User-Agent HTTP header in java code of a seam component or a listener ?

Thanks.

0 votes

1 answers

1743 views

ANSWER



Hi,

We actually do this in the VideoActions seam component:

    ExternalContext econtext = FacesContext.getCurrentInstance().getExternalContext();
    HttpServletRequest request = (HttpServletRequest) econtext.getRequest();
    return request.getHeader("User-Agent");
0 votes



It works ! Thank you.
01/14/2014