This article will concentrate on WebWork Java MVC framework, which is currently adapted as a base for the Struts 2 framework. I will show how to set up WebWork using enterprise scale tools such as JBuilder 2006 and BEA WebLogic and as an example create a sample application that uses some of the WebWork’s features. I will assume you have WebLogic (or comparable application server) installed and configured and are familiar with JBuilder IDE. Since WebWork is J2EE compliant other application servers, such as, Apache Tomcat, can be used as well.

Currently java development front is split into two main areas- Web development and Swing client-side GUI development. The Swing developers use excellent Swing toolkit and core Java APIs for majority of their GUI development needs. Java web developers also use core java APIs, but in addition they use frameworks. Most of the enterprise level web-based projects use some sort of an architecture that includes at least one framework. Why? This is because frameworks greatly simplify development and design of the project, decrease time to production, reduce amount of labor and code needed and improve application performance. I’ve described several major frameworks in my previous article "Enterprise Java Frameworks for Web Development".

WebWork

Every framework for web developments by design serves a specific purpose. It could be a Model-View-Controller implementation with Inversion of Control logic for coordination of client to server requests and actions on the server, separation of business logic from view layer, or java to SQL mapping to abstract interaction with database layer. Also it could be client data validation and view abstraction via custom framework tag libraries and JSTL (java standard tag libraries).

WebWork is a Model-View-Controlled type of framework. This means it separates logic from view and simplifies web development by using a powerful “action” concept on the server-side.

It is built on top of a command pattern framework API called XWork. WebWork specific features include: dispatchers that handle/delegate requests; result types that support several view technologies (JSP, Velocity, JasperReports, XML, FreeMarker); small but powerful library of JSP tags and Velocity macros. Dispatchers invoke specified XWork actions that access and manipulate the model and provide easy access for the view to display model data.

Setup Server Environment in JBuilder 2006

To get started with WebWork download it here
http://www.opensymphony.com/webwork/download.action

In JBuilder 2006 configure enterprise server to point to your BEA WebLogic installation. If you are using a different app server then, set up should be imilar. WebLogic domain and server should be set up and are beyond the scope of this article. Skip this section if you already have configured any application server in you IDE.

1. Choose Enterprise|Configure Servers.

The Configure Servers dialog box appears. (See below)

2. Select the WebLogic server 8.x by clicking it in the pane on the left. The right side of the dialog box lists the default settings for the selected server.

3. Check the Enable Server check box at the top of the dialog box. Checking this option enables the fields for the selected application server. You won’t be able to edit any fields until it is checked. The Enable Server check box also determines whether this server will appear in the list of servers when you select a server for your project using the Servers page of the Project|Project Properties dialog box.

JBuilder provides default settings for the selected server. If JBuilder’s default settings are not appropriate, edit any of the settings as needed. Some servers require you to enter settings in addition to the defaults. Clicking the OK button in this dialog box when not all required values are set or selecting another server while the current one is enabled displays a message dialog box that informs you about the missing settings.