Programming Thoughts
J2EE - Post/Redirect/Get
Example

Displaying search results in pages

The previous set of articles, starting at Post/Redirect/Get discusses how Struts 2 gets in the way of the Post/Redirect/Get design pattern and how Struts 2 can be extended to support it. This article describes a working example. It's also the working example for Pagination, Editing.

Live example

A demonstration application can be accessed here. The start page looks like the following.

Figure 1: Starting page

Download

Source code of a demonstration application can be downloaded here as a zip file. It requires the following.

  • JDK 8 or better
  • Maven 3
  • Jakarta EE server, such as Tomcat 9

It compiles into a WAR file and is run from the /example3 URL page. The start page looks like the following.

The application demonstrates finding, navigating and editing a simple, in-memory table of countries using list cache for pagination.