You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "David Mc (JIRA)" <ji...@apache.org> on 2010/01/05 18:50:44 UTC
[jira] Created: (WW-3368) ConventionUnknownHandler doesn't play
nicely with rest plugin
ConventionUnknownHandler doesn't play nicely with rest plugin
-------------------------------------------------------------
Key: WW-3368
URL: https://issues.apache.org/struts/browse/WW-3368
Project: Struts 2
Issue Type: Bug
Components: Plugin - Convention, Plugin - REST
Affects Versions: 2.1.8
Reporter: David Mc
Priority: Minor
ConventionUnknownHandler's handleUnknownActionMethod() always throws a NoSuchMethodException which does not play nicely with the REST plugin. The REST plugin will take urls such as /x/y/z and try and call a z() method on the action. If no such method exists, the desired behavior should be a 404 and not an error. My codebase has a second UnknownHandler implementation that takes care of the 404, but because the ConventionUnknownHandler throws an error rather than returning null, it never gets a chance to execute. The behavior that ConventionUnknownHandler should follow is to return null and allow any other registered handlers have a shot at dealing with the missing method. I have created a local patch with this change, and it works correctly.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (WW-3368) ConventionUnknownHandler doesn't play
nicely with rest plugin
Posted by "Lukasz Lenart (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-3368?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lukasz Lenart resolved WW-3368.
-------------------------------
Resolution: Fixed
Fix Version/s: 2.2.x
Assignee: Lukasz Lenart
Solved, thanks for the patch!
Regards
--
Lukasz
> ConventionUnknownHandler doesn't play nicely with rest plugin
> -------------------------------------------------------------
>
> Key: WW-3368
> URL: https://issues.apache.org/struts/browse/WW-3368
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Convention, Plugin - REST
> Affects Versions: 2.1.8
> Reporter: David Mc
> Assignee: Lukasz Lenart
> Priority: Minor
> Fix For: 2.2.x
>
>
> ConventionUnknownHandler's handleUnknownActionMethod() always throws a NoSuchMethodException which does not play nicely with the REST plugin. The REST plugin will take urls such as /x/y/z and try and call a z() method on the action. If no such method exists, the desired behavior should be a 404 and not an error. My codebase has a second UnknownHandler implementation that takes care of the 404, but because the ConventionUnknownHandler throws an error rather than returning null, it never gets a chance to execute. The behavior that ConventionUnknownHandler should follow is to return null and allow any other registered handlers have a shot at dealing with the missing method. I have created a local patch with this change, and it works correctly.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WW-3368) ConventionUnknownHandler doesn't play
nicely with rest plugin
Posted by "David Mc (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-3368?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=47216#action_47216 ]
David Mc commented on WW-3368:
------------------------------
In case it isn't obvious, here is the patch to src/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionUnknownHandler.java
412c412
< throw new NoSuchMethodException();
---
> return null;
> ConventionUnknownHandler doesn't play nicely with rest plugin
> -------------------------------------------------------------
>
> Key: WW-3368
> URL: https://issues.apache.org/struts/browse/WW-3368
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Convention, Plugin - REST
> Affects Versions: 2.1.8
> Reporter: David Mc
> Priority: Minor
>
> ConventionUnknownHandler's handleUnknownActionMethod() always throws a NoSuchMethodException which does not play nicely with the REST plugin. The REST plugin will take urls such as /x/y/z and try and call a z() method on the action. If no such method exists, the desired behavior should be a 404 and not an error. My codebase has a second UnknownHandler implementation that takes care of the 404, but because the ConventionUnknownHandler throws an error rather than returning null, it never gets a chance to execute. The behavior that ConventionUnknownHandler should follow is to return null and allow any other registered handlers have a shot at dealing with the missing method. I have created a local patch with this change, and it works correctly.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.