You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Bill Dudney <bd...@mac.com> on 2004/11/21 22:06:46 UTC

converter tags

Hi All,

I've discovered a bug in the converter tags.

the release() method sets the _converterId to null.

The lifecycle goes like this;

1) new
2) setters, setPageContext, setParent
3) doStartTag, doEndTag etc
4) release

then loop through 2-4.

On Tomcat this works fine because tomcat creates a new instance of the 
tag each time (does all of 1-4 each time) however on WebLogic a pool of 
instances is created and reused (i.e. only 2-4 are redone each time).

So I have fixed the problem by placing

setConverterId(DateTimeConverter.CONVERTER_ID)

in the setPageContext method. The other option is to place the call to 
setConverterId into the createConverter method. Either way will work 
but I think the setPageContext method is 'more correct'.

I'll be checking it in later today if I don't hear any opinion either 
way.

TTFN,

-bd-


Re: converter tags

Posted by Bill Dudney <bd...@mac.com>.
Perhaps an even better solution is to override getConverterType and  
always return the constant. Also do the same in getValidatorType for  
the validtor tags too.

Thoughts?

TTFN,

-bd-
On Nov 21, 2004, at 5:34 PM, Bill Dudney wrote:

> I'll check the rest of the validator tags before I make the commit.
>
> Thanks!
>
> -bd-
>
> On Nov 21, 2004, at 2:44 PM, Matthias Wessendorf wrote:
>
>> Bill,
>>
>> a time ago, there was an related issue to this
>> regarding the email-validator tags.
>>
>> Daniel Kamakura told us about that.
>> However see here the cvs-change-log:
>> http://cvs.apache.org/viewcvs.cgi/incubator-myfaces/src/components/ 
>> org/a
>> pache/myfaces/custom/emailvalidator/ValidateEmailTag.java? 
>> r1=1.2&r2=1.3&
>> diff_format=h
>>
>>
>> Regards,
>> Matthias
>>
>>> -----Original Message-----
>>> From: Bill Dudney [mailto:bdudney@mac.com]
>>> Sent: Sunday, November 21, 2004 10:07 PM
>>> To: MyFaces DevList
>>> Subject: converter tags
>>>
>>>
>>> Hi All,
>>>
>>> I've discovered a bug in the converter tags.
>>>
>>> the release() method sets the _converterId to null.
>>>
>>> The lifecycle goes like this;
>>>
>>> 1) new
>>> 2) setters, setPageContext, setParent
>>> 3) doStartTag, doEndTag etc
>>> 4) release
>>>
>>> then loop through 2-4.
>>>
>>> On Tomcat this works fine because tomcat creates a new
>>> instance of the
>>> tag each time (does all of 1-4 each time) however on WebLogic
>>> a pool of
>>> instances is created and reused (i.e. only 2-4 are redone each time).
>>>
>>> So I have fixed the problem by placing
>>>
>>> setConverterId(DateTimeConverter.CONVERTER_ID)
>>>
>>> in the setPageContext method. The other option is to place
>>> the call to
>>> setConverterId into the createConverter method. Either way will work
>>> but I think the setPageContext method is 'more correct'.
>>>
>>> I'll be checking it in later today if I don't hear any opinion either
>>> way.
>>>
>>> TTFN,
>>>
>>> -bd-
>>>
>>
>


Re: converter tags

Posted by Bill Dudney <bd...@mac.com>.
I'll check the rest of the validator tags before I make the commit.

Thanks!

-bd-

On Nov 21, 2004, at 2:44 PM, Matthias Wessendorf wrote:

> Bill,
>
> a time ago, there was an related issue to this
> regarding the email-validator tags.
>
> Daniel Kamakura told us about that.
> However see here the cvs-change-log:
> http://cvs.apache.org/viewcvs.cgi/incubator-myfaces/src/components/ 
> org/a
> pache/myfaces/custom/emailvalidator/ValidateEmailTag.java? 
> r1=1.2&r2=1.3&
> diff_format=h
>
>
> Regards,
> Matthias
>
>> -----Original Message-----
>> From: Bill Dudney [mailto:bdudney@mac.com]
>> Sent: Sunday, November 21, 2004 10:07 PM
>> To: MyFaces DevList
>> Subject: converter tags
>>
>>
>> Hi All,
>>
>> I've discovered a bug in the converter tags.
>>
>> the release() method sets the _converterId to null.
>>
>> The lifecycle goes like this;
>>
>> 1) new
>> 2) setters, setPageContext, setParent
>> 3) doStartTag, doEndTag etc
>> 4) release
>>
>> then loop through 2-4.
>>
>> On Tomcat this works fine because tomcat creates a new
>> instance of the
>> tag each time (does all of 1-4 each time) however on WebLogic
>> a pool of
>> instances is created and reused (i.e. only 2-4 are redone each time).
>>
>> So I have fixed the problem by placing
>>
>> setConverterId(DateTimeConverter.CONVERTER_ID)
>>
>> in the setPageContext method. The other option is to place
>> the call to
>> setConverterId into the createConverter method. Either way will work
>> but I think the setPageContext method is 'more correct'.
>>
>> I'll be checking it in later today if I don't hear any opinion either
>> way.
>>
>> TTFN,
>>
>> -bd-
>>
>


RE: converter tags

Posted by Matthias Wessendorf <ma...@matthias-wessendorf.de>.
Bill,

a time ago, there was an related issue to this
regarding the email-validator tags.

Daniel Kamakura told us about that.
However see here the cvs-change-log:
http://cvs.apache.org/viewcvs.cgi/incubator-myfaces/src/components/org/a
pache/myfaces/custom/emailvalidator/ValidateEmailTag.java?r1=1.2&r2=1.3&
diff_format=h


Regards,
Matthias

> -----Original Message-----
> From: Bill Dudney [mailto:bdudney@mac.com] 
> Sent: Sunday, November 21, 2004 10:07 PM
> To: MyFaces DevList
> Subject: converter tags
> 
> 
> Hi All,
> 
> I've discovered a bug in the converter tags.
> 
> the release() method sets the _converterId to null.
> 
> The lifecycle goes like this;
> 
> 1) new
> 2) setters, setPageContext, setParent
> 3) doStartTag, doEndTag etc
> 4) release
> 
> then loop through 2-4.
> 
> On Tomcat this works fine because tomcat creates a new 
> instance of the 
> tag each time (does all of 1-4 each time) however on WebLogic 
> a pool of 
> instances is created and reused (i.e. only 2-4 are redone each time).
> 
> So I have fixed the problem by placing
> 
> setConverterId(DateTimeConverter.CONVERTER_ID)
> 
> in the setPageContext method. The other option is to place 
> the call to 
> setConverterId into the createConverter method. Either way will work 
> but I think the setPageContext method is 'more correct'.
> 
> I'll be checking it in later today if I don't hear any opinion either 
> way.
> 
> TTFN,
> 
> -bd-
>