[
https://issues.apache.org/struts/browse/WW-2428?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43280#action_43280
]
Jeromy Evans commented on WW-2428:
----------------------------------
I generally resist adding flags like these too.
However, in the specific case where the NamedVariablePatternMatcher is used,
this seems the only way to prevent the RestActionMapper from mangling the
namespace and action name prior to the named variable extraction. Without this
flag, the RestActionMapper baulks at the namespace that contains variables and
eagerly matches the default blank namespace instead. When that occurs, the
blank namespace is all the NamedVariablePatternMatcher gets to work with. I'll
probably look for a nicer solution later.
> Add alwaysSelectFullNamespace support to RestActionMapper
> ---------------------------------------------------------
>
> Key: WW-2428
> URL: https://issues.apache.org/struts/browse/WW-2428
> Project: Struts 2
> Issue Type: Improvement
> Components: Other
> Affects Versions: 2.1.1
> Reporter: Jeromy Evans
> Assignee: Don Brown
> Priority: Minor
> Fix For: 2.1.1
>
> Attachments: rest16Jan08.patch
>
>
> Since WW-1523 (Rev491547) the DefaultActionMapper includes an
> alwaysSelectFullNamespace property that when set forces selection of the
> entire path as the action's namespace instead of attempting to find a
> partial/default namespace match.
> This flag is also required in the RestActionMapper to allow use of the
> NamedVariablePatternMatcher. The flag is essential to ensure the full
> namespace (including variables) is passed to the NamedVariablePatternMatcher
> without mutilation by the RestActionMapper. Otherwise the RestActionMapper
> fails to match actions with NamvedVariable namespaces and falls back to the
> default (blank) namespace. The NamedVariablePatternMatcher subsequently only
> processes the blank namespace.
> The code from the DefaultActionMapper can be copied directly to the
> RestActionMapper (patch to be attached).
> It's not particularly elegant that the PatternMatcher isn't executed until
> after the ActionMapper has attempted to match the namespace, but I see no
> obvious alternative short of incorporating PatternMatcher into the
> ActionMapper.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.