Hi Dim,
I've just tested it, and it works. The action :
@UrlBinding("/test.action")
public class TestAction implements ActionBean {
private ActionBeanContext context; // get/set
public Resolution foo() {
return new StreamingResolution("text/plain", "Resolution foo()");
}
public String foo(String bar) {
return "doh : " + bar;
}
@DefaultHandler
public Resolution display() {
return new StreamingResolution("text/html", "Try the 'foo'
event : <a href='/test.action?foo=true'>foo</a>");
}
}
As expected, when you send a request to
http://.../test.action?foo=true, the method returning Resolution is
used.
You might have encountered the issue if you have your own action
resolver which extends AnnotatedClassActionResolver. Strangely, the
check for event handler's signature is done in NameBasedActionResolver
(in overriden getHandledEvent()), a subclass of
AnnotatedClassActionResolver.
Maybe we should get that higher in the hierarchy...
I don't think an even can be a method that doesn't return a
Resolution, and passing parameters to it seems irrelevant.
Anyone knows if there's a reason for this design ?
Cheers
Remi
On 10/25/07, Dmitri Colebatch <[EMAIL PROTECTED]> wrote:
> Hi guys,
>
> One of the guys at work found a problem where if you have two methods:
>
> String foo(String bar) {}
> Resolution foo() {}
>
> The first one will be called instead of the second. This looks like a
> problem in AnnotatedClassActionResolver which I think the attached
> (tiny) patch fixes. Could someone please take a look and apply if
> appropriate?
>
> cheers,
> dim
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Stripes-development mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-development
>
>
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development