I would like to know if it is possible to block access to a Tomcat server if the uses uses Internet Explorer 6. Our application requires Internet Explorer 8 and accessing it with IE6 can lead to some kind of trouble, so we are looking for a configuration option which allows us to define valid and/or invalid frontends.
On the server side, one way to filter is by writing a custom Valve which examines the user agent string. However, Valves are Tomcat specific, and are relatively rare in the field. So writing a valve may lead to code maintenance issues in future.
A better way, in my opinion, is to write a servlet filter which does the same. Servlet filters are part of the servlet standards, and hence compatible across servlet containers.
One more way, if using spring framework, is spring interceptors.
Instead of repeating the details, I'll just [url=http://www.tomcatexpert.com/ask-the-experts/useragentvalve]link to an article[/link] that already shows how to do this.
Karthik has already detailed out, how to identify the browser/version.
Once you have done identifying, it might be a nice touch to also provide a download link for IE8 (or whatever minimum IE version you support) or better yet, Chrome! Identifying the problem and providing a solution to the end user = good usability