Programming Thoughts
Struts 2 - Annotation-based Validation
Fixing Duplicate Parameter Names Example

Analysing a Struts 2 feature

Struts 2 is a popular MVC framework for Java-based web applications but its annotation-based validation doesn't properly work. So, an alternative was created but it leaves multiple request parameters with the same name to manual code. Alas, Struts 2 annotations don't properly work with those either, so the alternative was updated. This article describes an example to illustrate this fix.

Live example

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

Figure 1: Starting page

Download

A demonstration application can be downloaded here as zip files. They require the following.

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

Extract the Example 13 files and run mvn, which compiles into example13.war. Copy that into your Jakarta server run the /example13 URL.