Files
struts/plugins/rest
Lukasz Lenart ca6312347f WW-5688 fix(rest): resolve id-bearing URIs into the root namespace when declared (#1863)
RestActionMapper mapped a URI carrying an id into the default namespace while
mapping the same action without an id into "/". Since the configuration only
fails over from "/" to "" and never the other way round, an action declared in
a package with namespace="/" resolved for index but 404'd for show, update and
destroy.

DefaultActionMapper already handles this: WW-2461 added a rootAvailable check
in June 2008, three months before WW-2820 reported the REST symptom, but the
fix was never ported to the mapper the REST plugin had forked earlier. Port it,
keeping the ordering that computes the action name while the namespace is still
empty, since the name is relative to it.

The promotion only fires when a package explicitly declares namespace="/" and
nothing more specific matched. Convention derives "" or "/sub" and never "/",
so applications that do not opt in are unaffected, and because a "/" lookup
already falls back to "", the set of resolvable actions is a superset of the
previous one.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-24 11:19:43 +02:00
..

Struts 2 REST plugin

The REST Plugin provides high level support for the implementation of RESTful resource based web applications with the Convention Plugin. You will find more details in documentation.

Installation

Just drop this plugin JAR into WEB-INF/lib folder or add it as a Maven dependency.