HomeDigital EditionSys-Con RadioSearch Java Cd
Advanced Java AWT Book Reviews/Excerpts Client Server Corba Editorials Embedded Java Enterprise Java IDE's Industry Watch Integration Interviews Java Applet Java & Databases Java & Web Services Java Fundamentals Java Native Interface Java Servlets Java Beans J2ME Libraries .NET Object Orientation Observations/IMHO Product Reviews Scalability & Performance Security Server Side Source Code Straight Talking Swing Threads Using Java with others Wireless XML
 

Developing Web Applications Using VisualAge for JAva and WebSphere Studio, by Anita Huang & Tim deBoer

Your team has been assigned to build an end-to-end Web application. As a Java programmer, you need to focus on the code, to ensure that it can successfully call the required data. Your graphic and Web designers need to focus on the actual presentation to the user, to determine how best to display the information.

To ease the server-side programming process, it makes sense to build the application using a role-based approach:

  • Business logic: Determines the content generated
  • Presentation style and content: Determines how the information is presented
Whether you're a Java programmer who wants to work on the server side of a Web application or a graphic designer who may be more interested in working on the client view of the application, VisualAge for Java and WebSphere Studio provide the tools you need.

In creating a Web application, it's common to create Enterprise JavaBeans to access the back-end data (the business logic side of the application), servlets to control the flow through the application, and JavaServer Pages to display the information to the user (the presentation style and content of the application). In this scenario the Java programmer would concentrate on developing the EJB and the graphic designer would concentrate on the JSP design. Depending on skill or complexity, both could work on the servlets.

IBM provides VisualAge for Java for your server-side EJB development and WebSphere Studio for your client-side JSP/Servlet development. In Part 1 of this series we provide you with an overview of the tools available for Web application development and how they can be used to build and debug a complete end-to-end Web application. In Part 2 we'll build a complete Web site from the EJB created in the article "Building Enterprise Beans with VisualAge for Java" (JDJ, Vol. 5, issue 6).

Summary of Tools
WebSphere Studio

WebSphere Studio is a suite of tools that allows everyone on the Web development team to work together. It helps page designers, graphic artists, programmers and Web masters to work in such a way that each particular expert in the field can concentrate on doing his or her job well. The tools provided with WebSphere Studio help you to create, assemble, publish and maintain dynamic interactive Web applications powered by IBM's WebSphere Application Server. Use WebSphere Studio tools to create HTML, JSP and servlet files.

WebSphere Studio provides the following tools that will be useful for your client-side development.

  • JavaBean Wizard: Allows you to import a JavaBean and then generate from it an HTML input page, a servlet that uses the bean, a servlet configuration file and a JSP file to dynamically display the results to the user.
  • Page Designer: Advanced HTML editor that allows you to easily edit and create HTML and JSP files; provides support for servlets, JavaBeans and JavaScript so you can integrate these technologies with the generated client files. Also provides scripts for you to incorporate into your Web pages so you don't have to write the code yourself.
  • WebArt Designer and Animated GIF Designer: These tools enable you to create your own images.
VisualAge for Java
VisualAge for Java, an enterprise-level Java development environment, provides a complete team-programming environment with all the tools you need as a professional Java developer. It's used to create JavaBeans, complex servlets and EJB, as well as to run, test and debug your Web application.

VisualAge for Java provides the following tools for Web-based development.

  • WebSphere Test Environment: One of the biggest reasons to use VisualAge for Java as a development environment. This feature is a fully functional version of WebSphere Application Server that can run entirely within the VisualAge for Java IDE. This means you can run your entire application within the development environment, making use of the integrated tools and debugging support.

    As you build the application, you can configure the WebSphere Test Environment to match your deployment platform, including the creation of multiple Web applications, virtual paths and aliases. This allows you to re-create your entire deployment environment for debugging and testing before you deploy the application.

  • EJB server: The EJB development and test environment was covered in the June article referenced earlier. It also allows you to run the WebSphere Advanced EJB server inside VisualAge for Java.

    Figure 1 shows the EJB Server Configuration dialog. In the left pane you can start the Persistent Name Server and any number of EJB servers. The right pane shows the EJB groups and EJBs within the selected server. You can use this dialog to configure deployment descriptors for your EJBs and to set up the properties of the various servers.

    Figure 1: EJB Server Configuration window
    Figure 1

    To test your EJBs, you can run both the EJB server and any number of client applications, all within VisualAge for Java. If the client application isn't finished (or for rapid testing of EJBs), a test client can be generated automatically. This test client is a simple application that allows you to test access to both the home and remote interfaces of each EJB. When you want to access the EJBs from a client application, VisualAge for Java can generate access EJBs that allow a client application to connect to your EJBs without writing any EJB code.

  • Integrated Debugger: As with any program running inside VisualAge for Java, your Web applications can also make use of the VisualAge for Java integrated Debugger. This tool allows you to debug your servlets, EJBs and JavaBeans just as you would in any other application, including setting breakpoints and setting up watches on variables. Perhaps the biggest bonus comes with the incremental compiler built into the VisualAge for Java IDE. When you find a bug, you can fix it and have it compiled directly into the running code without stopping and restarting the Web or EJB servers! This feature alone can save plenty of time during development.

    Figure 2: Options for JSP Execution Monitor
    Figure 2

  • JSP Execution Monitor: Allows you to debug JSP pages within the IDE. Figure 2 shows the JSP Execution Monitor options, which allow you to turn JSP page debugging on or off and set which options to use. The highlighted option, "Retrieve syntax error information," allows you to debug Java syntax errors in the JSP page.

    Figure 3: JSP Execution Monitor
    Figure 3

    Figure 3 shows the JSP Execution Monitor window during execution. In the top pane are the JSP pages that have been run inside the Jmonitor. When these pages are initially compiled, the two middle frames show, respectively, the original JSP page source and the servlet generated from that source. As you step through the page using the toolbar, the current source is highlighted in both panes, and the HTML output from this source is displayed in the bottom pane. With familiar debugging features like breakpoints and step-through, the JSP Execution Monitor allows you to rapidly diagnose and fix errors in your JSP pages, whether they're Java coding errors or incorrect output from JavaBeans used by the JSP page.

· · ·
Next month we'll provide a detailed tutorial that walks you through the steps involved in developing a Web application using VisualAge for Java and WebSphere Studio.

Author Bios
Anita Huang is currently working on IBM's WebSphere Developer Domain site, providing in-depth samples and tutorials that incorporate the WebSphere software platform for e-business. Previously, she worked on the VisualAge for Java Information Development team, focusing primarily on componentry to build enterprise applications. Anita can be contacted at: [email protected]

Tim deBoer currently develops tools to build applications that run on WebSphere Application Server. He previously worked with the VisualAge for Java Technical Support group, providing support to enterprise developers working with VisualAge for Java. Tim can be contacted at: [email protected]

 

All Rights Reserved
Copyright ©  2004 SYS-CON Media, Inc.
  E-mail: [email protected]

Java and Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. SYS-CON Publications, Inc. is independent of Sun Microsystems, Inc.