[
https://issues.apache.org/jira/browse/WW-2820?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18107172#comment-18107172
]
Lukasz Lenart commented on WW-2820:
-----------------------------------
Triaged against current {{main}} (7.4.0-SNAPSHOT). This ticket bundles five
unrelated claims taken from a 2008 mailing-list post, so it cannot be closed
coherently as a unit. Disposition of each, then closing this umbrella.
_1. Blank namespace vs "/" - STILL VALID, reproduced._ Split out as WW-5688.
With a package declared at namespace {{/}}, {{GET /dog}} maps to namespace
{{/}} and resolves, while {{GET /dog/1}} maps to the empty namespace and 404s -
so {{index}} works but {{show}}/{{update}}/{{destroy}} do not. Root cause is in
{{RestActionMapper.parseNameAndNamespace()}}; details on WW-5688.
_2. Namespace must be prefixed with a slash_ - reproduces, but this is
correct-by-design: Struts namespaces are absolute paths. Declaring {{v1}}
instead of {{/v1}} yields a nonsense mapping (name {{v1}}, method {{1}}, id
{{dog}}), but the fix is documentation, not code. Not carried forward as a bug.
_3. Tiles/JSP folder sharing a name with a namespace_ - no verdict. This is
servlet-container and filter-dispatch behaviour, not reproducible at the
action-mapper level, and the original report has no runnable repro. If this
still bites anyone, please open a fresh ticket with a minimal war.
_4. Actions must be suffixed with {{Controller}} - OBSOLETE._ That requirement
came from the Codebehind settings the REST plugin used to inherit
({{struts.codebehind.classSuffix=Controller}}), removed in commit {{a83155009}}
back in December 2008 (2.1.6); the Codebehind plugin itself is long gone. The
Convention plugin's default suffix is {{Action}}, and no suffix is mandatory
beyond what {{struts.convention.action.suffix}} configures.
_5. Action name identical to its package name - does not reproduce._
{{/space/space}} maps cleanly to namespace {{/space}}, name {{space}}. The only
name-collision guard in Convention is against the action _suffix_, not the
package name. This most likely died together with item 4.
Closing this as superseded by WW-5688, which carries the one live defect.
> REST Plugin Issues/Improvements
> -------------------------------
>
> Key: WW-2820
> URL: https://issues.apache.org/jira/browse/WW-2820
> Project: Struts 2
> Issue Type: Improvement
> Components: Plugin - REST
> Affects Versions: 2.1.2
> Reporter: Alvin Singh
> Priority: Major
> Fix For: 7.4.0
>
>
> I didn't know whether I should create separate issues for each (some are not
> issues but just require some doco). Issues described here -
> http://www.nabble.com/forum/ViewPost.jtp?post=19230238&framed=y -
> - If you want a blank namespace - do not use "/" as your namespace in your
> struts xml's or in namespace notation. Inconsistent behavior starts to occur.
> - If you want a specific namespace - e.g. /v1 - you must ensure your
> namespace has prefixed slash i.e. "/v1" otherwise it will not work
> - If you are using tiles or even jsp (I think) and have the same name folder
> as a namespace your rest urls will not execute the action
> - Your actions/controllers must be suffixed with 'Controller' or the action
> mapper will not pick them up (wiki says it is optional)
> - If you have a action/controller name the same as the package name its in -
> strange things happen (can't find action mapping etc.). e.g package name is
> au.com.test.rest.space, class in this package with name SpaceController will
> not work correctly - SpacesController will.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)