You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Jeromy Evans (JIRA)" <ji...@apache.org> on 2008/01/16 11:44:07 UTC

[jira] Created: (WW-2428) Add alwaysSelectFullNamespace support to RestActionMapper

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
            Priority: Minor


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.


[jira] Reopened: (WW-2428) Add alwaysSelectFullNamespace support to RestActionMapper

Posted by "Jeromy Evans (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2428?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeromy Evans reopened WW-2428:
------------------------------

      Assignee:     (was: Don Brown)

Reversed patch. alwaysSelectFullNamespace defaults to true in the default no-configuration case.
Including support for alwaysSelectFullNamespace breaks the default use case.

> 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
>            Priority: Minor
>             Fix For: 2.1.x
>
>         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.


[jira] Resolved: (WW-2428) Add alwaysSelectFullNamespace support to RestActionMapper

Posted by "Jeromy Evans (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2428?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeromy Evans resolved WW-2428.
------------------------------

    Resolution: Won't Fix
      Assignee: Jeromy Evans

The flag needs to be true (unmodified) to use codebehind with the rest plugin. and the default action mapper.  My use case was out of the normal realm so this change doesn't need to be applied.

> Add alwaysSelectFullNamespace support to RestActionMapper
> ---------------------------------------------------------
>
>                 Key: WW-2428
>                 URL: https://issues.apache.org/struts/browse/WW-2428
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Plugin - REST
>    Affects Versions: 2.1.1
>            Reporter: Jeromy Evans
>            Assignee: Jeromy Evans
>            Priority: Minor
>             Fix For: 2.1.3
>
>         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.


[jira] Updated: (WW-2428) Add alwaysSelectFullNamespace support to RestActionMapper

Posted by "Jeromy Evans (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2428?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeromy Evans updated WW-2428:
-----------------------------

    Fix Version/s:     (was: 2.1.1)
                   2.1.x

Pushed to 2.1.x as it's not required for 2.1.1

> 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
>            Priority: Minor
>             Fix For: 2.1.x
>
>         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.


[jira] Updated: (WW-2428) Add alwaysSelectFullNamespace support to RestActionMapper

Posted by "Jeromy Evans (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2428?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeromy Evans updated WW-2428:
-----------------------------

    Attachment: rest16Jan08.patch

Attached patch adds the DefaultActionMapper's 4 lines of alwaysSelectFullNamespace logic to RestActionMapper.java

> 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
>            Priority: Minor
>         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.


[jira] Updated: (WW-2428) Add alwaysSelectFullNamespace support to RestActionMapper

Posted by "Don Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2428?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Don Brown updated WW-2428:
--------------------------

    Fix Version/s:     (was: 2.1.x)
                   2.1.3

> 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
>            Priority: Minor
>             Fix For: 2.1.3
>
>         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.


[jira] Resolved: (WW-2428) Add alwaysSelectFullNamespace support to RestActionMapper

Posted by "Don Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2428?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Don Brown resolved WW-2428.
---------------------------

    Resolution: Fixed
      Assignee: Don Brown

I'm not really sure that you'd even want to use this option, but there it is...thanks for the patch.

> 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.


[jira] Commented: (WW-2428) Add alwaysSelectFullNamespace support to RestActionMapper

Posted by "Jeromy Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2428?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43318#action_43318 ] 

Jeromy Evans commented on WW-2428:
----------------------------------

Confirmed.  That's not good.  I'm going to roll back this patch until I've got better test cases.

> 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.


[jira] Updated: (WW-2428) Add alwaysSelectFullNamespace support to RestActionMapper

Posted by "Don Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2428?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Don Brown updated WW-2428:
--------------------------

    Component/s:     (was: Other)
                 Plugin - REST

> Add alwaysSelectFullNamespace support to RestActionMapper
> ---------------------------------------------------------
>
>                 Key: WW-2428
>                 URL: https://issues.apache.org/struts/browse/WW-2428
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Plugin - REST
>    Affects Versions: 2.1.1
>            Reporter: Jeromy Evans
>            Priority: Minor
>             Fix For: 2.1.3
>
>         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.


[jira] Commented: (WW-2428) Add alwaysSelectFullNamespace support to RestActionMapper

Posted by "Jeromy Evans (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Commented: (WW-2428) Add alwaysSelectFullNamespace support to RestActionMapper

Posted by "Sarat Pediredla (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2428?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43316#action_43316 ] 

Sarat Pediredla commented on WW-2428:
-------------------------------------

It might be worth adding a note to the documentation saying that you now need to set alwaysSelectFullNamespace=false in a Tomcat environment to enable the Rest code to effectively auto map to actions in your default namespaces as if you dont do this, it always seems to run this code, although I thought the default for alwaysSelectFullNamespace was false?

Basically if alwaysSelectFullNamespace is not set to false, all the old REST code breaks on a Tomcat 6.0 instance.

> 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.