I have a web application in which I have certain components that should not be rendered if the browser is Internet Explorer.
I can technically use jquery but I’m assuming that’s no good because it’s a client side code and the rendered attribute is computed on the server.
How can I do this?
You could check if the
User-Agentheader contains the stringMSIE. Here’s an overview of all “valid” MSIE header strings: http://www.useragentstring.com/pages/Internet%20Explorer/ You’ll see that all MSIE strings share the same pattern"; MSIE ". You could check on that:or when you are not on Servlet 3.0 / EL 2.2 yet:
You however need to be aware that this is a client-controlled value and can easily be changed/spoofed. Doing the checks in the client side using for example conditional comments is much more reliable as MSIE is really the only browser which interprets them.