Supporting Bidirectional Languages in HTML-Client Applications

To ensure that the HTML in your BI Beans servlet application is rendered in the correct direction, the HTML code generation should set the the DIR attribute of the <HTML> tag. Internet Explorer 5.x and Netscape 6 support the DIR attribute.

The UIX DocumentBean class, in the oracle.cabo.ui.beans package, automatically generates the correct HTML tags for a page, including the rendering of the DIR attribute. The DocumentBean retrieves the correct reading direction from the LocaleContext on the ServletRenderingContext, so you do not need to do anything else to ensure the correct direction.

The following code shows how to use the DocumentBean to render a page to the servlet response.


response.setContentType("text/html;charset=" + charset) PrintWriter writer = response.getWriter(); ServletRenderingContext context = new ServletRenderingContext(this, request, response, writer); // Set the locale on the rendering context, if needed context.setLocaleContext(new LocaleContext(myLocale)); // Create the page to render DocumentBean document = new DocumentBean(); // Create the header HeadBean head = new HeadBean(); // add the head to the document document.addIndexedChild(head) // add the body to the document BodyBean body = new BodyBean(); // ... add thin beans and other UIX beans to the page -- code not provided in this example // add the body to the document document.addIndexedChild(body); // render the document document.render(context);