Using browser capability
The browser capability servlet (BrowserCapability) is available in the run-time environment in <WAS_HOME>\wcp\runtime\userServlets\com\ibm\servlet\personalization\util\browsercapability.
To use BrowserCapability in your application:
- Use the Application Assembly tool from the WebSphere Application Server Administrator Console and open your ear file.
- New a Web component.
- Name - BrowserCapabilityServlet
- Servlet Class - com.ibm.servlet.personalization.util.browsercapability.BrowserCapabilityServlet
- Add Servlet Mapping.
- URL Pattern - BrowserCapabilityServlet
- Servlet - BrowserCapabilityServlet
The URL pattern you specify here must be used as the servletURL in the page that initializes BrowserCapability.
Publish the BrowserCapability.js, BrowserCapability.vbs and SinglePixel.gif files available under <rad_root>\plugins\com.ibm.wcm.resource.wizards\scripts folder to your server. These must be published to a Web application in your Enterprise application.
<HEAD> <SCRIPT LANGUAGE=“VBScript” SRC=“http://hostname/contextRoot/path/BrowserCapability.vbs”> </SCRIPT> <SCRIPT LANGUAGE=“JavaScript” SRC=“http://hostname/contextRoot/path/BrowserCapability.js”> </SCRIPT> </HEAD> <BODY> <script language=“JavaScript”> var servletURL=“/contextRoot/BrowserCapabilityServlet”; var bc = new BrowserCapability(servletURL); </script> <noscript> <img src=“/contextRoot/BrowserCapabilityServlet? imageURL=http://hostname/contextRoot/path/SinglePixel.gif”> </noscript> </BODY>Where hostname is the name of your server (such as localhost) and contextRoot and path define the address of the file.
Home |
WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.
IBM is a trademark of the IBM Corporation in the United States, other countries, or both.