We're trying to design a system based on a J2EE application server. The system can have multiple clients: interactive voice response, web, wireless, PDAs. How can we utilize XML? Should servlets, jsp, session bean, entity bean, or javabean generate xml output to send to these different clients?

Shuchi Agarwal

XML can be used for both static as well as dynamic content.

For rendering of static data you can probably apply XSL stylesheets on the XML content files stored on your Web Server. These XSL files can generate HTML or WML depending on where the response has to be sent. For dymanic content you can pull out enterprise data or data from a B2B transaction data and generate XML on the fly. You can still use the XSL stylesheets to send the data to different clients.

How you do it is entirely dependent on the requirements of the application but you should still utilize the MVC pattern of web application design. So in this case your JavaBeans/session beans will contain the XML data (static or dynamic) which has to be rendered, JSP will be the view used to generate/render that data on the client and servlets as an interaction controller. EJB's are required if the application is highly transaction oriented.