This article shows how to use the Ibm®websphere®application Server Feature Pack for WEB 2.0 to enhance java™2 Platform with Ajax-style architecture, Enterprise Edition (Java EE) application. Learn how to combine Ajax-style architectures with existing applications without rewriting the entire WEB application. In addition, you will learn how to apply the WEB 2.0 Feature Pack to a Java EE application that targets IBM WebSphere application Server.
The Plants by WebSphere application is one of many sample programs that are available with IBM WebSphere application Server Feature Pack for Web 2.0. This application demonstrates a typical Java EE application and how to enhance it with an Ajax-style architecture without rewriting the entire application. This sample application is virtual with an online plant store where customers can order and purchase flowers, trees, plants, and other accessories. Figure 1 shows the home page for this WEB application:
Figure 1:plants by WebSphere Web application
Figure 2 shows the original architecture of this application before adding Ajax style features. The architecture was designed to represent a typical Java EE application that runs on a WebSphere application Server. At the high level, this application follows a Model-view-controller (MVC) design pattern, which is a pattern that many WEB applications use in varying degrees. The browser accesses the URL of the application and returns an HTML page rendered by the JSP. The browser makes an extra request to the application, which is used to control the process that the user buys the request-driven. Enterprise JavaBeans (EJB) is used to service model data that is available on the database.
Figure 2: A typical WEB architecture
Figure 3 below shows how the original architecture of the application was extended using Ajax. The goal is to not rewrite the application, using only the technology in the IBM Feature Pack to improve and create a more interactive, rich user experience.
On the browser side, the application uses the widgets provided by the JavaScript Dojo Toolkit. In addition, the custom user interface widget is created to improve the interactivity of Plants by WebSphere without overwriting it. Custom user interface widgets are asynchronous, which means that they communicate using the XHR mechanism of browsers supported by the Dojo Toolkit. These widgets use an XML Interchange format to Exchange data with the server. On the server side, the rpcadapter provided with the Feature Pack is used to convert the EJB data into an XML interchange format, which is easily used by newly created widgets on the browser.