You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ilya Obshadko <il...@gmail.com> on 2014/01/21 02:59:21 UTC

kaptcha component reloading issues with Firefox

I'm not sure if anyone else has that issue: reloading the zone containing
kaptcha component does not trigger image reloading, so the whole thing
becomes unusable (because internal CAPTCHA text is already different, but
image is not). This affects ONLY Firefox, all the other major browsers are
OK. Don't have an idea why (probably Firefox doesn't respect cache control
headers because of some reasons).

After spending some time to fix it, I've ended up with simple
copy-and-paste versions of KaptchaField and KaptchaImage classes with only
one small difference in KaptchaImage:


    boolean beginRender(MarkupWriter writer)

    {

        captchaText = producer.createText();



        Link link = resources.createEventLink("image",
RandomStringUtils.randomAlphanumeric ( 8 ) );


        writer.element("img",


                "src", link.toURI(),


                "width", producer.getWidth(),


                "height", producer.getHeight());


        resources.renderInformalParameters(writer);


        writer.end();


        return false;

    }

It might be a good idea to fix it in the main branch.

-- 
Ilya Obshadko

Re: kaptcha component reloading issues with Firefox

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Fri, 24 Jan 2014 19:48:13 -0200, Dimitris Zenios  
<di...@gmail.com> wrote:

> I prefer number 3.

Fixed using option number 3. :)

>
>
> On Fri, Jan 24, 2014 at 10:13 PM, Bob Harner <bo...@gmail.com> wrote:
>
>> Actually, Tapestry's Response interface and ResponseImpl
>> implementation (a thin facade over HttpServletResponse) don't include
>> an addHeader method, so we would either have to 1) combine the two
>> setHeader calls or 2) use HttpServletResponse directly, or 3) change
>> the Response interface (a backward-incompatible API change, although
>> maybe worth doing, since I guess very few people would be affected).
>>
>> On Fri, Jan 24, 2014 at 2:56 PM, Dimitris Zenios
>> <di...@gmail.com> wrote:
>> > It would be nice also to provide a patch file.The only change needed  
>> is
>> to
>> > replace the second setHeader with addHeader. After that we can inform  
>> a
>> > person with commit access to merge your patch.
>> >
>> >
>> > On Fri, Jan 24, 2014 at 1:22 AM, Ilya Obshadko  
>> <ilya.obshadko@gmail.com
>> >wrote:
>> >
>> >> Okay, https://issues.apache.org/jira/browse/TAP5-2275
>> >>
>> >>
>> >> On Fri, Jan 24, 2014 at 8:46 AM, Dimitris Zenios
>> >> <di...@gmail.com>wrote:
>> >>
>> >> > You should start by writing a jira bug report
>> >> > On 23 Jan 2014 00:09, "Ilya Obshadko" <il...@gmail.com>
>> wrote:
>> >> >
>> >> > > So I have discussed the issue with Kaptcha library author and  
>> found
>> out
>> >> > > that the problem is, in fact, with Tapestry implementation  
>> itself.
>> >> > >
>> >> > > https://code.google.com/p/kaptcha/issues/detail?id=72
>> >> > >
>> >> > > Tapestry component uses response.setHeader("Cache-Control")  
>> twice,
>> and
>> >> > the
>> >> > > second call obviously overrides the first one. Is it going to be
>> fixed?
>> >> > >
>> >> > >
>> >> > >
>> >> > > On Tue, Jan 21, 2014 at 12:59 PM, Ilya Obshadko <
>> >> ilya.obshadko@gmail.com
>> >> > > >wrote:
>> >> > >
>> >> > > > I'm not sure if anyone else has that issue: reloading the zone
>> >> > containing
>> >> > > > kaptcha component does not trigger image reloading, so the  
>> whole
>> >> thing
>> >> > > > becomes unusable (because internal CAPTCHA text is already
>> different,
>> >> > but
>> >> > > > image is not). This affects ONLY Firefox, all the other major
>> >> browsers
>> >> > > are
>> >> > > > OK. Don't have an idea why (probably Firefox doesn't respect  
>> cache
>> >> > > control
>> >> > > > headers because of some reasons).
>> >> > > >
>> >> > > > After spending some time to fix it, I've ended up with simple
>> >> > > > copy-and-paste versions of KaptchaField and KaptchaImage  
>> classes
>> with
>> >> > > only
>> >> > > > one small difference in KaptchaImage:
>> >> > > >
>> >> > > >
>> >> > > >     boolean beginRender(MarkupWriter writer)
>> >> > > >
>> >> > > >     {
>> >> > > >
>> >> > > >         captchaText = producer.createText();
>> >> > > >
>> >> > > >
>> >> > > >
>> >> > > >         Link link = resources.createEventLink("image",
>> >> > > > RandomStringUtils.randomAlphanumeric ( 8 ) );
>> >> > > >
>> >> > > >
>> >> > > >         writer.element("img",
>> >> > > >
>> >> > > >
>> >> > > >                 "src", link.toURI(),
>> >> > > >
>> >> > > >
>> >> > > >                 "width", producer.getWidth(),
>> >> > > >
>> >> > > >
>> >> > > >                 "height", producer.getHeight());
>> >> > > >
>> >> > > >
>> >> > > >         resources.renderInformalParameters(writer);
>> >> > > >
>> >> > > >
>> >> > > >         writer.end();
>> >> > > >
>> >> > > >
>> >> > > >         return false;
>> >> > > >
>> >> > > >     }
>> >> > > >
>> >> > > > It might be a good idea to fix it in the main branch.
>> >> > > >
>> >> > > > --
>> >> > > > Ilya Obshadko
>> >> > > >
>> >> > > >
>> >> > >
>> >> > >
>> >> > > --
>> >> > > Ilya Obshadko
>> >> > >
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> Ilya Obshadko
>> >>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>


-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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


Re: kaptcha component reloading issues with Firefox

Posted by Dimitris Zenios <di...@gmail.com>.
I prefer number 3.


On Fri, Jan 24, 2014 at 10:13 PM, Bob Harner <bo...@gmail.com> wrote:

> Actually, Tapestry's Response interface and ResponseImpl
> implementation (a thin facade over HttpServletResponse) don't include
> an addHeader method, so we would either have to 1) combine the two
> setHeader calls or 2) use HttpServletResponse directly, or 3) change
> the Response interface (a backward-incompatible API change, although
> maybe worth doing, since I guess very few people would be affected).
>
> On Fri, Jan 24, 2014 at 2:56 PM, Dimitris Zenios
> <di...@gmail.com> wrote:
> > It would be nice also to provide a patch file.The only change needed is
> to
> > replace the second setHeader with addHeader. After that we can inform a
> > person with commit access to merge your patch.
> >
> >
> > On Fri, Jan 24, 2014 at 1:22 AM, Ilya Obshadko <ilya.obshadko@gmail.com
> >wrote:
> >
> >> Okay, https://issues.apache.org/jira/browse/TAP5-2275
> >>
> >>
> >> On Fri, Jan 24, 2014 at 8:46 AM, Dimitris Zenios
> >> <di...@gmail.com>wrote:
> >>
> >> > You should start by writing a jira bug report
> >> > On 23 Jan 2014 00:09, "Ilya Obshadko" <il...@gmail.com>
> wrote:
> >> >
> >> > > So I have discussed the issue with Kaptcha library author and found
> out
> >> > > that the problem is, in fact, with Tapestry implementation itself.
> >> > >
> >> > > https://code.google.com/p/kaptcha/issues/detail?id=72
> >> > >
> >> > > Tapestry component uses response.setHeader("Cache-Control") twice,
> and
> >> > the
> >> > > second call obviously overrides the first one. Is it going to be
> fixed?
> >> > >
> >> > >
> >> > >
> >> > > On Tue, Jan 21, 2014 at 12:59 PM, Ilya Obshadko <
> >> ilya.obshadko@gmail.com
> >> > > >wrote:
> >> > >
> >> > > > I'm not sure if anyone else has that issue: reloading the zone
> >> > containing
> >> > > > kaptcha component does not trigger image reloading, so the whole
> >> thing
> >> > > > becomes unusable (because internal CAPTCHA text is already
> different,
> >> > but
> >> > > > image is not). This affects ONLY Firefox, all the other major
> >> browsers
> >> > > are
> >> > > > OK. Don't have an idea why (probably Firefox doesn't respect cache
> >> > > control
> >> > > > headers because of some reasons).
> >> > > >
> >> > > > After spending some time to fix it, I've ended up with simple
> >> > > > copy-and-paste versions of KaptchaField and KaptchaImage classes
> with
> >> > > only
> >> > > > one small difference in KaptchaImage:
> >> > > >
> >> > > >
> >> > > >     boolean beginRender(MarkupWriter writer)
> >> > > >
> >> > > >     {
> >> > > >
> >> > > >         captchaText = producer.createText();
> >> > > >
> >> > > >
> >> > > >
> >> > > >         Link link = resources.createEventLink("image",
> >> > > > RandomStringUtils.randomAlphanumeric ( 8 ) );
> >> > > >
> >> > > >
> >> > > >         writer.element("img",
> >> > > >
> >> > > >
> >> > > >                 "src", link.toURI(),
> >> > > >
> >> > > >
> >> > > >                 "width", producer.getWidth(),
> >> > > >
> >> > > >
> >> > > >                 "height", producer.getHeight());
> >> > > >
> >> > > >
> >> > > >         resources.renderInformalParameters(writer);
> >> > > >
> >> > > >
> >> > > >         writer.end();
> >> > > >
> >> > > >
> >> > > >         return false;
> >> > > >
> >> > > >     }
> >> > > >
> >> > > > It might be a good idea to fix it in the main branch.
> >> > > >
> >> > > > --
> >> > > > Ilya Obshadko
> >> > > >
> >> > > >
> >> > >
> >> > >
> >> > > --
> >> > > Ilya Obshadko
> >> > >
> >> >
> >>
> >>
> >>
> >> --
> >> Ilya Obshadko
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: kaptcha component reloading issues with Firefox

Posted by Bob Harner <bo...@gmail.com>.
Actually, Tapestry's Response interface and ResponseImpl
implementation (a thin facade over HttpServletResponse) don't include
an addHeader method, so we would either have to 1) combine the two
setHeader calls or 2) use HttpServletResponse directly, or 3) change
the Response interface (a backward-incompatible API change, although
maybe worth doing, since I guess very few people would be affected).

On Fri, Jan 24, 2014 at 2:56 PM, Dimitris Zenios
<di...@gmail.com> wrote:
> It would be nice also to provide a patch file.The only change needed is to
> replace the second setHeader with addHeader. After that we can inform a
> person with commit access to merge your patch.
>
>
> On Fri, Jan 24, 2014 at 1:22 AM, Ilya Obshadko <il...@gmail.com>wrote:
>
>> Okay, https://issues.apache.org/jira/browse/TAP5-2275
>>
>>
>> On Fri, Jan 24, 2014 at 8:46 AM, Dimitris Zenios
>> <di...@gmail.com>wrote:
>>
>> > You should start by writing a jira bug report
>> > On 23 Jan 2014 00:09, "Ilya Obshadko" <il...@gmail.com> wrote:
>> >
>> > > So I have discussed the issue with Kaptcha library author and found out
>> > > that the problem is, in fact, with Tapestry implementation itself.
>> > >
>> > > https://code.google.com/p/kaptcha/issues/detail?id=72
>> > >
>> > > Tapestry component uses response.setHeader("Cache-Control") twice, and
>> > the
>> > > second call obviously overrides the first one. Is it going to be fixed?
>> > >
>> > >
>> > >
>> > > On Tue, Jan 21, 2014 at 12:59 PM, Ilya Obshadko <
>> ilya.obshadko@gmail.com
>> > > >wrote:
>> > >
>> > > > I'm not sure if anyone else has that issue: reloading the zone
>> > containing
>> > > > kaptcha component does not trigger image reloading, so the whole
>> thing
>> > > > becomes unusable (because internal CAPTCHA text is already different,
>> > but
>> > > > image is not). This affects ONLY Firefox, all the other major
>> browsers
>> > > are
>> > > > OK. Don't have an idea why (probably Firefox doesn't respect cache
>> > > control
>> > > > headers because of some reasons).
>> > > >
>> > > > After spending some time to fix it, I've ended up with simple
>> > > > copy-and-paste versions of KaptchaField and KaptchaImage classes with
>> > > only
>> > > > one small difference in KaptchaImage:
>> > > >
>> > > >
>> > > >     boolean beginRender(MarkupWriter writer)
>> > > >
>> > > >     {
>> > > >
>> > > >         captchaText = producer.createText();
>> > > >
>> > > >
>> > > >
>> > > >         Link link = resources.createEventLink("image",
>> > > > RandomStringUtils.randomAlphanumeric ( 8 ) );
>> > > >
>> > > >
>> > > >         writer.element("img",
>> > > >
>> > > >
>> > > >                 "src", link.toURI(),
>> > > >
>> > > >
>> > > >                 "width", producer.getWidth(),
>> > > >
>> > > >
>> > > >                 "height", producer.getHeight());
>> > > >
>> > > >
>> > > >         resources.renderInformalParameters(writer);
>> > > >
>> > > >
>> > > >         writer.end();
>> > > >
>> > > >
>> > > >         return false;
>> > > >
>> > > >     }
>> > > >
>> > > > It might be a good idea to fix it in the main branch.
>> > > >
>> > > > --
>> > > > Ilya Obshadko
>> > > >
>> > > >
>> > >
>> > >
>> > > --
>> > > Ilya Obshadko
>> > >
>> >
>>
>>
>>
>> --
>> Ilya Obshadko
>>

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


Re: kaptcha component reloading issues with Firefox

Posted by Dimitris Zenios <di...@gmail.com>.
It would be nice also to provide a patch file.The only change needed is to
replace the second setHeader with addHeader. After that we can inform a
person with commit access to merge your patch.


On Fri, Jan 24, 2014 at 1:22 AM, Ilya Obshadko <il...@gmail.com>wrote:

> Okay, https://issues.apache.org/jira/browse/TAP5-2275
>
>
> On Fri, Jan 24, 2014 at 8:46 AM, Dimitris Zenios
> <di...@gmail.com>wrote:
>
> > You should start by writing a jira bug report
> > On 23 Jan 2014 00:09, "Ilya Obshadko" <il...@gmail.com> wrote:
> >
> > > So I have discussed the issue with Kaptcha library author and found out
> > > that the problem is, in fact, with Tapestry implementation itself.
> > >
> > > https://code.google.com/p/kaptcha/issues/detail?id=72
> > >
> > > Tapestry component uses response.setHeader("Cache-Control") twice, and
> > the
> > > second call obviously overrides the first one. Is it going to be fixed?
> > >
> > >
> > >
> > > On Tue, Jan 21, 2014 at 12:59 PM, Ilya Obshadko <
> ilya.obshadko@gmail.com
> > > >wrote:
> > >
> > > > I'm not sure if anyone else has that issue: reloading the zone
> > containing
> > > > kaptcha component does not trigger image reloading, so the whole
> thing
> > > > becomes unusable (because internal CAPTCHA text is already different,
> > but
> > > > image is not). This affects ONLY Firefox, all the other major
> browsers
> > > are
> > > > OK. Don't have an idea why (probably Firefox doesn't respect cache
> > > control
> > > > headers because of some reasons).
> > > >
> > > > After spending some time to fix it, I've ended up with simple
> > > > copy-and-paste versions of KaptchaField and KaptchaImage classes with
> > > only
> > > > one small difference in KaptchaImage:
> > > >
> > > >
> > > >     boolean beginRender(MarkupWriter writer)
> > > >
> > > >     {
> > > >
> > > >         captchaText = producer.createText();
> > > >
> > > >
> > > >
> > > >         Link link = resources.createEventLink("image",
> > > > RandomStringUtils.randomAlphanumeric ( 8 ) );
> > > >
> > > >
> > > >         writer.element("img",
> > > >
> > > >
> > > >                 "src", link.toURI(),
> > > >
> > > >
> > > >                 "width", producer.getWidth(),
> > > >
> > > >
> > > >                 "height", producer.getHeight());
> > > >
> > > >
> > > >         resources.renderInformalParameters(writer);
> > > >
> > > >
> > > >         writer.end();
> > > >
> > > >
> > > >         return false;
> > > >
> > > >     }
> > > >
> > > > It might be a good idea to fix it in the main branch.
> > > >
> > > > --
> > > > Ilya Obshadko
> > > >
> > > >
> > >
> > >
> > > --
> > > Ilya Obshadko
> > >
> >
>
>
>
> --
> Ilya Obshadko
>

Re: kaptcha component reloading issues with Firefox

Posted by Ilya Obshadko <il...@gmail.com>.
Okay, https://issues.apache.org/jira/browse/TAP5-2275


On Fri, Jan 24, 2014 at 8:46 AM, Dimitris Zenios
<di...@gmail.com>wrote:

> You should start by writing a jira bug report
> On 23 Jan 2014 00:09, "Ilya Obshadko" <il...@gmail.com> wrote:
>
> > So I have discussed the issue with Kaptcha library author and found out
> > that the problem is, in fact, with Tapestry implementation itself.
> >
> > https://code.google.com/p/kaptcha/issues/detail?id=72
> >
> > Tapestry component uses response.setHeader("Cache-Control") twice, and
> the
> > second call obviously overrides the first one. Is it going to be fixed?
> >
> >
> >
> > On Tue, Jan 21, 2014 at 12:59 PM, Ilya Obshadko <ilya.obshadko@gmail.com
> > >wrote:
> >
> > > I'm not sure if anyone else has that issue: reloading the zone
> containing
> > > kaptcha component does not trigger image reloading, so the whole thing
> > > becomes unusable (because internal CAPTCHA text is already different,
> but
> > > image is not). This affects ONLY Firefox, all the other major browsers
> > are
> > > OK. Don't have an idea why (probably Firefox doesn't respect cache
> > control
> > > headers because of some reasons).
> > >
> > > After spending some time to fix it, I've ended up with simple
> > > copy-and-paste versions of KaptchaField and KaptchaImage classes with
> > only
> > > one small difference in KaptchaImage:
> > >
> > >
> > >     boolean beginRender(MarkupWriter writer)
> > >
> > >     {
> > >
> > >         captchaText = producer.createText();
> > >
> > >
> > >
> > >         Link link = resources.createEventLink("image",
> > > RandomStringUtils.randomAlphanumeric ( 8 ) );
> > >
> > >
> > >         writer.element("img",
> > >
> > >
> > >                 "src", link.toURI(),
> > >
> > >
> > >                 "width", producer.getWidth(),
> > >
> > >
> > >                 "height", producer.getHeight());
> > >
> > >
> > >         resources.renderInformalParameters(writer);
> > >
> > >
> > >         writer.end();
> > >
> > >
> > >         return false;
> > >
> > >     }
> > >
> > > It might be a good idea to fix it in the main branch.
> > >
> > > --
> > > Ilya Obshadko
> > >
> > >
> >
> >
> > --
> > Ilya Obshadko
> >
>



-- 
Ilya Obshadko

Re: kaptcha component reloading issues with Firefox

Posted by Dimitris Zenios <di...@gmail.com>.
You should start by writing a jira bug report
On 23 Jan 2014 00:09, "Ilya Obshadko" <il...@gmail.com> wrote:

> So I have discussed the issue with Kaptcha library author and found out
> that the problem is, in fact, with Tapestry implementation itself.
>
> https://code.google.com/p/kaptcha/issues/detail?id=72
>
> Tapestry component uses response.setHeader("Cache-Control") twice, and the
> second call obviously overrides the first one. Is it going to be fixed?
>
>
>
> On Tue, Jan 21, 2014 at 12:59 PM, Ilya Obshadko <ilya.obshadko@gmail.com
> >wrote:
>
> > I'm not sure if anyone else has that issue: reloading the zone containing
> > kaptcha component does not trigger image reloading, so the whole thing
> > becomes unusable (because internal CAPTCHA text is already different, but
> > image is not). This affects ONLY Firefox, all the other major browsers
> are
> > OK. Don't have an idea why (probably Firefox doesn't respect cache
> control
> > headers because of some reasons).
> >
> > After spending some time to fix it, I've ended up with simple
> > copy-and-paste versions of KaptchaField and KaptchaImage classes with
> only
> > one small difference in KaptchaImage:
> >
> >
> >     boolean beginRender(MarkupWriter writer)
> >
> >     {
> >
> >         captchaText = producer.createText();
> >
> >
> >
> >         Link link = resources.createEventLink("image",
> > RandomStringUtils.randomAlphanumeric ( 8 ) );
> >
> >
> >         writer.element("img",
> >
> >
> >                 "src", link.toURI(),
> >
> >
> >                 "width", producer.getWidth(),
> >
> >
> >                 "height", producer.getHeight());
> >
> >
> >         resources.renderInformalParameters(writer);
> >
> >
> >         writer.end();
> >
> >
> >         return false;
> >
> >     }
> >
> > It might be a good idea to fix it in the main branch.
> >
> > --
> > Ilya Obshadko
> >
> >
>
>
> --
> Ilya Obshadko
>

Re: kaptcha component reloading issues with Firefox

Posted by Ilya Obshadko <il...@gmail.com>.
So I have discussed the issue with Kaptcha library author and found out
that the problem is, in fact, with Tapestry implementation itself.

https://code.google.com/p/kaptcha/issues/detail?id=72

Tapestry component uses response.setHeader("Cache-Control") twice, and the
second call obviously overrides the first one. Is it going to be fixed?



On Tue, Jan 21, 2014 at 12:59 PM, Ilya Obshadko <il...@gmail.com>wrote:

> I'm not sure if anyone else has that issue: reloading the zone containing
> kaptcha component does not trigger image reloading, so the whole thing
> becomes unusable (because internal CAPTCHA text is already different, but
> image is not). This affects ONLY Firefox, all the other major browsers are
> OK. Don't have an idea why (probably Firefox doesn't respect cache control
> headers because of some reasons).
>
> After spending some time to fix it, I've ended up with simple
> copy-and-paste versions of KaptchaField and KaptchaImage classes with only
> one small difference in KaptchaImage:
>
>
>     boolean beginRender(MarkupWriter writer)
>
>     {
>
>         captchaText = producer.createText();
>
>
>
>         Link link = resources.createEventLink("image",
> RandomStringUtils.randomAlphanumeric ( 8 ) );
>
>
>         writer.element("img",
>
>
>                 "src", link.toURI(),
>
>
>                 "width", producer.getWidth(),
>
>
>                 "height", producer.getHeight());
>
>
>         resources.renderInformalParameters(writer);
>
>
>         writer.end();
>
>
>         return false;
>
>     }
>
> It might be a good idea to fix it in the main branch.
>
> --
> Ilya Obshadko
>
>


-- 
Ilya Obshadko