To support multiple languages, a BI Beans servlet application must manage the following localization issues:
The following example shows how to address these issues.
// support the proper character set 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 // Using the DocumentBean gives you the correct reading direction DocumentBean document = new DocumentBean(); // Create the header HeadBean head = new HeadBean(); // add meta tag for character set support HTMLWebBean meta = new HTMLWebBean("meta"); meta.setHTMLAttributeValue("http-equiv", "Content-Type"); meta.setHTMLAttributeValue("content", "text/html"); meta.setHTMLAttributeValue("charset", charset); head.addIndexedChild(meta); // add the head to the document document.addIndexedChild(head) // add the body to the document BodyBean body = new BodyBean(); document.addIndexedChild(body); // ... add thin beans and other UIX Components to the body bean // -- code not provided in this example // render the document document.render(context);