Embedding Java Applets in a Web Page

I have recently been experimenting with dynamically embedding Java applets within pages served by content management systems (CMS). As the <applet> and <embed> tags are depreciated and not XHTML standard compliant or supported by all browsers, that just leaves the <object> tag. This is fine, but even with this there are some serious inconsistencies between browser implementations - especially the Internet Explorer and the Mozilla/Gecko engines. This example shows how this can be solved fairly easily with some PHP in Drupal.

Browser Detection Methods

Whilst there may be many reasons for wanting to know which browser your web page is being viewed within, the main one I find is needing to tweak some CSS or embedded applet code to accommodate certain rendering inconsistencies. At first glance, this seems pretty easy with dynamically-generated pages as most server-side programming or scripting languages provide a way of doing this as the page is being assembled for delivery. However, for both static web pages and content that is likely to be cached by a content management system (CMS) it isn't so easy. This article therefore considers a range of available browser detection methods.