You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by justinjmiller <gi...@git.apache.org> on 2016/06/09 21:52:18 UTC

[GitHub] struts pull request #99: add allowed methods to handleUnknownAction

GitHub user justinjmiller opened a pull request:

    https://github.com/apache/struts/pull/99

    add allowed methods to handleUnknownAction

    Prior to strict-method-invocation, the convention plugin would allow for executing results (JSP) without an associated Action via the ConventionUnknownHandler.handleUnknownAction method.  This continues to work with SMI disabled but when enabled the allowedMethods list in the ActionConfig does not get populated which causes a 404.  There was already a member Set hard coded to the most common methods to which I added "index" used by the REST plugin.  
    
    Ideally, line 224 would use the globalAllowedMethods set from the PackageConfig instead of a hard coded list but there is currently no associated getter method and I figured it would be better to discuss adding that functionality via the PR.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/justinjmiller/struts convention-allowedMethods

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/struts/pull/99.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #99
    
----
commit 0d92fd0ee5d4c23aabe7bf3c2ef1b30ff3e5c00d
Author: jumiller <ju...@utah.gov>
Date:   2016-06-09T21:39:23Z

    add allowed methods to ActionBuilder

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


[GitHub] struts issue #99: add allowed methods to handleUnknownAction

Posted by cnenning <gi...@git.apache.org>.
Github user cnenning commented on the issue:

    https://github.com/apache/struts/pull/99
  
    > Ideally, line 224 would use the globalAllowedMethods set from the PackageConfig instead of a hard coded list but there is currently no associated getter method and I figured it would be better to discuss adding that functionality via the PR.
    
    IMHO a getter `getGlobalAllowedMethods()` can just be added to `PackageConfig`.
    
    @lukaszlenart Do you see reasons not to add the getter?



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


[GitHub] struts pull request #99: add allowed methods to handleUnknownAction

Posted by lukaszlenart <gi...@git.apache.org>.
Github user lukaszlenart commented on a diff in the pull request:

    https://github.com/apache/struts/pull/99#discussion_r66724460
  
    --- Diff: core/src/main/java/com/opensymphony/xwork2/config/entities/PackageConfig.java ---
    @@ -346,6 +346,13 @@ public boolean isNeedsRefresh() {
             return globalExceptionMappingConfigs;
         }
     
    +    /**
    +     * gets the GlobalAllowedMethods local to this package
    +     *
    +     * @return a Set of method names allowed to be executed if strict method invocation is enabled
    +     */
    +    public Set<String> getGlobalAllowedMethods() { return globalAllowedMethods; }
    --- End diff --
    
    Ok, I will do it after merge


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


[GitHub] struts issue #99: add allowed methods to handleUnknownAction

Posted by cnenning <gi...@git.apache.org>.
Github user cnenning commented on the issue:

    https://github.com/apache/struts/pull/99
  
    Please create a jira ticket, too. We usually document all changes in jira to generate change logs.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


[GitHub] struts pull request #99: add allowed methods to handleUnknownAction

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/struts/pull/99


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


[GitHub] struts pull request #99: add allowed methods to handleUnknownAction

Posted by lukaszlenart <gi...@git.apache.org>.
Github user lukaszlenart commented on a diff in the pull request:

    https://github.com/apache/struts/pull/99#discussion_r66703095
  
    --- Diff: core/src/main/java/com/opensymphony/xwork2/config/entities/PackageConfig.java ---
    @@ -346,6 +346,13 @@ public boolean isNeedsRefresh() {
             return globalExceptionMappingConfigs;
         }
     
    +    /**
    +     * gets the GlobalAllowedMethods local to this package
    +     *
    +     * @return a Set of method names allowed to be executed if strict method invocation is enabled
    +     */
    +    public Set<String> getGlobalAllowedMethods() { return globalAllowedMethods; }
    --- End diff --
    
    Can this return unmodifiable collections? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


[GitHub] struts issue #99: add allowed methods to handleUnknownAction

Posted by justinjmiller <gi...@git.apache.org>.
Github user justinjmiller commented on the issue:

    https://github.com/apache/struts/pull/99
  
    Agreed.  I added it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


[GitHub] struts issue #99: add allowed methods to handleUnknownAction

Posted by justinjmiller <gi...@git.apache.org>.
Github user justinjmiller commented on the issue:

    https://github.com/apache/struts/pull/99
  
    done - https://issues.apache.org/jira/browse/WW-4643


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org