Working with the struts framework in the web UI framework

The Web User Interface Framework is designed to use the Apache Struts 2 framework. This open source framework is used for developing Java™ web applications. Struts works on the UI backend and server side of an application, while the Ext JS JavaScript framework is used for the presentation layer of an application.

Struts is the primary framework used to develop the Java web components in the Web UI Framework, but other libraries like DWR can co-exist with Struts. Struts is designed to help developers create web applications that utilize the MVC (Model, View, Controller) architecture. To the user, the MVC architecture separates the business logic and application data from the presentation data.

At a high level, the Struts framework has three key components:
  • A request handler provided by the application developer that is mapped to a standard URI.
  • A response handler that transfers control to another resource which completes the response.
  • Tag libraries that help developers create interactive form-based applications with server pages.
    Note: This is the default Web UI Framework tag library, and not the default Struts tag library. IBM® does not provide the default Struts tag library.

The Struts layer is essentially a pass-through layer in the Web UI Framework. Its ability to co-exist with similar frameworks gives you the flexibility of choosing whether to completely rely on the Struts framework, based on the needs and architecture of an application. The Web UI Framework does have a minimal dependency on Struts, but Struts can be replaced with another framework.

Struts interacts in the UI backend part of the Web UI Framework with other parts of the Web UI Framework in the following ways:
  1. Accepts the initial frontend request that has passed through the authentication filter and other filters.
  2. Processes that request and then sends it to the mashup layer, which sends it to the business logic layer where the primary processing occurs.
  3. After the primary processing finishes, the Struts layer accepts the output of the mashup layer, and sends it to the presentation layer.

The following graphic shows how Struts interacts with other parts of the Web UI Framework:

A flow chart of Struts and the flow from Struts and other parts of the Web UI framework.

Using struts withWebSphere

If you are using the Web UI Framework with WebSphere®, you must set the following property value:

com.ibm.ws.webcontainer.invokefilterscompatibility=true

You can set this property through the IBM application console using the following commands:

Application Servers > <server> > Web Container Settings > Web Container > Customer Properties

Once you set this custom property value, you do not need to remove it, even if you upgrade an application server to a higher version of WebSphere.