Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add allowed methods to handleUnknownAction #99

Merged
merged 2 commits into from
Jun 12, 2016

Conversation

justinjmiller
Copy link
Contributor

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.

@cnenning
Copy link
Member

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?

…onConfig method in ConventionUnknownHandler to reference it
@justinjmiller
Copy link
Contributor Author

Agreed. I added it.

@cnenning
Copy link
Member

Please create a jira ticket, too. We usually document all changes in jira to generate change logs.

@justinjmiller
Copy link
Contributor Author

*
* @return a Set of method names allowed to be executed if strict method invocation is enabled
*/
public Set<String> getGlobalAllowedMethods() { return globalAllowedMethods; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this return unmodifiable collections?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will do it after merge

@asfgit asfgit merged commit dd3b80f into apache:master Jun 12, 2016
@justinjmiller justinjmiller deleted the convention-allowedMethods branch June 13, 2016 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants