tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Feindler <Markus.Feind...@gmx.de>
Subject Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer
Date Tue, 14 Sep 2010 18:05:16 GMT
  Sounds plausible, but how would a MethodFilter help? It can retrieve 
the TransformMethodSignature, but how to use that to create an advise?
> Hmm... just took a look at the code again and I think I see the problem.
>
> ///// This creates the method body if your class doesn't already implement it:
> transformation.addImplementedInterface(RequestParameterExtractor.class);
>
> TransformMethodSignature extractMethod = new
> TransformMethodSignature(Modifier.PUBLIC,
>      "Map<String, String>", "extractRequestParameters", null, null);
>
> /////  This is probably commented out because it always returns.
> // if (transformation.isDeclaredMethod(extractMethod)) {
> //    return;
> // }
>
> ///// This is apparently trying to re-create the method.
> transformation.getOrCreateMethod(extractMethod).addAdvice(new
> ComponentMethodAdvice(){
>
> You should call transformation.findMethods(filter); instead of
> getOrCreateMethod. I'm not sure why the getOrCreate is trying to
> implement the method if it's already there, but I'd guess it has
> something to do with your new TransformMethodSignature.
>
> Josh
>
> On Tue, Sep 14, 2010 at 10:20 AM, Markus Feindler
> <Markus.Feindler@gmx.de>  wrote:
>>   @Christoph:
>> Same Error
>>
>> @Josh
>> Yes, I also removed the Generic Map from the Interface.
>>
>> Just checked in debug method: the method indeed already exists (breakpoint:
>> line 1443 InternalClassTransformationImpl). But how come? Its never added
>> through my code.
>>> Did you take the type parameters off of the interface too (return a
>>> raw map)? Have you looked at with a debugger? Stick a breakpoint right
>>> before the exception and take a look at the methods in the ctclass.
>>>
>>> I can't look at it now but I'll try to reproduce the problem tonight.
>>>
>>> Josh
>>>
>>>
>>> On Tue, Sep 14, 2010 at 9:47 AM, Markus Feindler<Markus.Feindler@gmx.de>
>>>   wrote:
>>>>   Just tried, does not work :(.
>>>>> Have you tried without specify Generic types ?
>>>>>
>>>>> 2010/9/13 Christophe Cordenier<christophe.cordenier@gmail.com>
>>>>>
>>>>>> Oh, this is maybe due to generics...
>>>>>>
>>>>>> 2010/9/13 Markus Feindler<Markus.Feindler@gmx.de>
>>>>>>
>>>>>>> public interface RequestParameterExtractor {
>>>>>>>     Map<String, String>      extractRequestParameters();
>>>>>>> }
>>>>>>>
>>>>>>> is not equal to:
>>>>>>>
>>>>>>>
>>>>>>>      TransformMethodSignature extractMethod = new
>>>>>>> TransformMethodSignature(Modifier.PUBLIC,
>>>>>>>             "Map<String, String>", "extractRequestParameters",
null,
>>>>>>> null);
>>>>>>>
>>>>>>> ?
>>>>>>>
>>>>>>>
>>>>>>>   Everything looks good ... The only thing i see is that the
method
>>>>>>>> signature
>>>>>>>> is not exactly the same as the one declared in the interface.
>>>>>>>>
>>>>>>>> 2010/9/13 Markus Feindler<Markus.Feindler@gmx.de>
>>>>>>>>
>>>>>>>>    Am 13.09.2010 22:18, schrieb Thiago H. de Paula Figueiredo:
>>>>>>>>>   On Mon, 13 Sep 2010 17:02:02 -0300, Christophe Cordenier<
>>>>>>>>>
>>>>>>>>>> christophe.cordenier@gmail.com>       wrote:
>>>>>>>>>>
>>>>>>>>>>   Please, Can you provide your Tapestry Module class
that
>>>>>>>>>> contributes
>>>>>>>>>> your
>>>>>>>>>>
>>>>>>>>>>> worker ?
>>>>>>>>>>>
>>>>>>>>>>>   And the worker itself? It seems two different
worker instances
>>>>>>>>>>> are
>>>>>>>>>> trying
>>>>>>>>>> to add the same method to the same page class.
>>>>>>>>>>
>>>>>>>>>>   files attached! appreciate your help.
>>>>>>>>>>
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>
>>>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>
>>>>>>>
>>>>>> --
>>>>>> Regards,
>>>>>> Christophe Cordenier.
>>>>>>
>>>>>> Committer on Apache Tapestry 5
>>>>>> Co-creator of wooki @wookicentral.com
>>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Mime
View raw message