Browse DevX
Sign up for e-mail newsletters from DevX


Building Internationalized J2EE Web Applications for Disparate Clients : Page 2

Learn an extensible architecture for building internationalized Web applications with J2EE that support not only browsers, but also WAP, IMODE, and other client devices.




Building the Right Environment to Support AI, Machine Learning and Deep Learning

Considerations and Recommendations
Table 1 shows some of the major considerations and recommendations for a disparate client application.

Consideration Recommendation
How can you provide support for multiple user agents?

Use common server side code for all user agents...

Use XML and XSLT. The XML documents contain data common to all clients. The XSLT performs the transformations required to change the XML into the format appropriate for each user agent.

Set the generated response depending MIME types appropriately for the requesting device. To respond to a WML request, for example, the MIME type must be set to text/vnd.wap.wml.

Should you perform XSLT Transformations on the server or on the client? Always use server-side transformations. Not all user agents support client-side transforms.
How can you provide support for I18N?

UTF-8 encoding format MUST be used.

Use the ResourceBundle and Message Bundle classes and java.text package.

Can the application rely on cookies for state management? No.
Without cookies, how can you manage session data? Use URL re-writingsome user agents don't support cookies.
Should you use absolute or relative URLs to reference server resources? Use absolute URLs to avoid potential problems with user-agents that don't support relative URLs.

Sample Application Overview
In this simple example scenario the first JSP page in the application displays a page containing hyperlinks. When the user clicks on a link, the application responds with a specific page. to accept choices and second one will be a resultant page. The figures below show how the application looks when accessed from a Web browser (see Figure 2), from a WAP emulator (see Figure 3) and from an iMode phone (see Figure 4). As you can see, the content of this sample application is extremely simple, so you can concentrate on how the application generates appropriate language and device specific responses.

Figure 2 - User making a request with a WEB user agent
Figure 3 - User making request with a WAP user agent
Figure 4 - User making request with an iMode user agent
The complete request/response cycle for this application consists of four main components:

  • A JSP page, which provides the logic that processes the request and drives the response sequence.
  • An XML generator, responsible for generating an XML page.
  • An XSL stylesheet, which formats the response appropriately for the requesting user agent. XSLT is used for server side transformation.
  • A Resource Bundle file, which provides I18N support
Figure 5 shows a sequence diagram that illustrates the order in which the application initiates each of the components to complete a request/response cycle.

Figure 5 - The sequence diagram shows the generalized interaction of the main application components
Figure 6 shows the top-level application deployment architecture, and illustrates the placement and the interaction sequence between the components.

Figure. 6: Disparate Client Support Application Deployment Architecture (J2EE)

Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date