You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Pavel Vodenski <pa...@beckon.com> on 2012/09/01 00:08:00 UTC

Re: Strange problem with Taha's AjaxUpload

The stream can only be read once, so if you have another request filter
running before the AjaxFileUploadDecoder you'll need to make sure that it
did not read out the stream first.

- P

On Fri, Aug 31, 2012 at 3:02 AM, Rural Hunter <ru...@gmail.com> wrote:

> I'm using Tapestry 5.3.3 and AjaxUpload comp blogged by Taha here:
> http://tawus.wordpress.com/**2011/06/25/ajax-upload-for-**tapestry/<http://tawus.wordpress.com/2011/06/25/ajax-upload-for-tapestry/>
> Everything works fine but there is a strange problem. Sometimes the file
> uploaded is alwasy empty(size 0). I checked AjaxFileUploadDecoderImpl.**setupUploadedFile
> and suspected the problem is in TapestryInternalUtils.copy. So I tried to
> read the inputstream of the request myself. But strangely I always got
> return value -1 when I call the inputream.read when the problem happens.
> Looks the inputstream is totally empty. I checked the request sent by
> browser with firebug and can see the content is sent by post. Don't know
> why I just can not read it at server end.
> One more interesting thing is that, this problem only happens sometimes
> after tomcat6 is recycled. Fore example, I recycle tomcat 10 times and only
> get problem with 1 time. With that recycle, all the file upload fails. The
> problelm persists until I recycle tomcat again. With a good recycle, the
> problem doesn't happen at all. I tested this on several machines with
> different tomcat versions and see the same problem on all of them. I can
> not get any clue and hope someone could give me some light.  Thanks in
> advance.
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@tapestry.apache.org>
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Strange problem with Taha's AjaxUpload

Posted by Rural Hunter <ru...@gmail.com>.
I checked the code of tapestry-jquery and I think it should be fine 
without setting the ordering. tapestry-jquery checks the same header to 
determine if it's a request from its file upload comp. Since I already 
changed that header, tapestry-jquery won't process and read the reqeust 
inputstream.

于 2012/9/1 23:45, Taha Siddiqi 写道:
> I think that should work too but you have to ensure that your filter is before the tapestry-jquery filter by using before:AjaxUploadFilter for ordering.
>
> On Sep 1, 2012, at 8:56 PM, Rural Hunter wrote:
>
>> How would that work? will it disable both filters? One way I figured out is: I changed the filter name and the AJAX_UPLOAD_HEADER in your code. I think it should work. am I right?
>>
>> 于 2012/9/1 18:19, Taha Siddiqi 写道:
>>> One way to handle it would be to contribute an override for "AjaxUploadFilter" to HttpServletRequestHandler with an empty implementation of HttpServletRequestFilter
>>>
>>> Some thing like
>>>
>>> public static void contributeHttpServletRequestHandler(final OrderedConfiguration<HttpServletRequestFilter> configuration,
>>>      final AjaxUploadDecoder ajaxUploadDecoder) {
>>>      configuration.override("AjaxUploadFilter", new EmptyHttpServletRequestImpl());
>>> }
>>>
>>> regards
>>> Taha
>>>
>>>
>>>
>>> On Sep 1, 2012, at 2:02 PM, Rural Hunter wrote:
>>>
>>>> Hi Taha,
>>>>
>>>> I used your comp first. Then other memeber in the team introduced tapestry-jquery later. besides, I do more like the appearance of your comp than he one in tapestry-jquery.
>>>>
>>>> 于 2012/9/1 14:29, Taha Hafeez Siddiqi 写道:
>>>>> If you are already using tapestry-jquery why not use it's own Ajaxupload component
>>>>>
>>>>> Sent from my iPhone
>>>>>
>>>>> On 01-Sep-2012, at 11:15 AM, Rural Hunter <ru...@gmail.com> wrote:
>>>>>
>>>>>> Yes, thanks. I found that tapestry-jquery in my classpath and it intercept the post request first sometimes. I'm wondering if there is any specific order the request flows among several request filter chain contributed into Tapestry HttpRequestHandler? From what I have seen, seems the order is random among every application starts but it's fixed once the application is started. is there any doc describe the order?
>>>>>>
>>>>>> 于 2012/9/1 6:08, Pavel Vodenski 写道:
>>>>>>> The stream can only be read once, so if you have another request filter
>>>>>>> running before the AjaxFileUploadDecoder you'll need to make sure that it
>>>>>>> did not read out the stream first.
>>>>>>>
>>>>>>> - P
>>>>>>>
>>>>>>> On Fri, Aug 31, 2012 at 3:02 AM, Rural Hunter <ru...@gmail.com> wrote:
>>>>>>>
>>>>>>>> I'm using Tapestry 5.3.3 and AjaxUpload comp blogged by Taha here:
>>>>>>>> http://tawus.wordpress.com/**2011/06/25/ajax-upload-for-**tapestry/<http://tawus.wordpress.com/2011/06/25/ajax-upload-for-tapestry/>
>>>>>>>> Everything works fine but there is a strange problem. Sometimes the file
>>>>>>>> uploaded is alwasy empty(size 0). I checked AjaxFileUploadDecoderImpl.**setupUploadedFile
>>>>>>>> and suspected the problem is in TapestryInternalUtils.copy. So I tried to
>>>>>>>> read the inputstream of the request myself. But strangely I always got
>>>>>>>> return value -1 when I call the inputream.read when the problem happens.
>>>>>>>> Looks the inputstream is totally empty. I checked the request sent by
>>>>>>>> browser with firebug and can see the content is sent by post. Don't know
>>>>>>>> why I just can not read it at server end.
>>>>>>>> One more interesting thing is that, this problem only happens sometimes
>>>>>>>> after tomcat6 is recycled. Fore example, I recycle tomcat 10 times and only
>>>>>>>> get problem with 1 time. With that recycle, all the file upload fails. The
>>>>>>>> problelm persists until I recycle tomcat again. With a good recycle, the
>>>>>>>> problem doesn't happen at all. I tested this on several machines with
>>>>>>>> different tomcat versions and see the same problem on all of them. I can
>>>>>>>> not get any clue and hope someone could give me some light.  Thanks in
>>>>>>>> advance.
>>>>>>>>
>>>>>>>>
>>>>>>>> ------------------------------**------------------------------**---------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@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
>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>
>


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


Re: Strange problem with Taha's AjaxUpload

Posted by Taha Siddiqi <ta...@gmail.com>.
I think that should work too but you have to ensure that your filter is before the tapestry-jquery filter by using before:AjaxUploadFilter for ordering.

On Sep 1, 2012, at 8:56 PM, Rural Hunter wrote:

> How would that work? will it disable both filters? One way I figured out is: I changed the filter name and the AJAX_UPLOAD_HEADER in your code. I think it should work. am I right?
> 
> 于 2012/9/1 18:19, Taha Siddiqi 写道:
>> One way to handle it would be to contribute an override for "AjaxUploadFilter" to HttpServletRequestHandler with an empty implementation of HttpServletRequestFilter
>> 
>> Some thing like
>> 
>> public static void contributeHttpServletRequestHandler(final OrderedConfiguration<HttpServletRequestFilter> configuration,
>>     final AjaxUploadDecoder ajaxUploadDecoder) {
>>     configuration.override("AjaxUploadFilter", new EmptyHttpServletRequestImpl());
>> }
>> 
>> regards
>> Taha
>> 
>> 
>> 
>> On Sep 1, 2012, at 2:02 PM, Rural Hunter wrote:
>> 
>>> Hi Taha,
>>> 
>>> I used your comp first. Then other memeber in the team introduced tapestry-jquery later. besides, I do more like the appearance of your comp than he one in tapestry-jquery.
>>> 
>>> 于 2012/9/1 14:29, Taha Hafeez Siddiqi 写道:
>>>> If you are already using tapestry-jquery why not use it's own Ajaxupload component
>>>> 
>>>> Sent from my iPhone
>>>> 
>>>> On 01-Sep-2012, at 11:15 AM, Rural Hunter <ru...@gmail.com> wrote:
>>>> 
>>>>> Yes, thanks. I found that tapestry-jquery in my classpath and it intercept the post request first sometimes. I'm wondering if there is any specific order the request flows among several request filter chain contributed into Tapestry HttpRequestHandler? From what I have seen, seems the order is random among every application starts but it's fixed once the application is started. is there any doc describe the order?
>>>>> 
>>>>> 于 2012/9/1 6:08, Pavel Vodenski 写道:
>>>>>> The stream can only be read once, so if you have another request filter
>>>>>> running before the AjaxFileUploadDecoder you'll need to make sure that it
>>>>>> did not read out the stream first.
>>>>>> 
>>>>>> - P
>>>>>> 
>>>>>> On Fri, Aug 31, 2012 at 3:02 AM, Rural Hunter <ru...@gmail.com> wrote:
>>>>>> 
>>>>>>> I'm using Tapestry 5.3.3 and AjaxUpload comp blogged by Taha here:
>>>>>>> http://tawus.wordpress.com/**2011/06/25/ajax-upload-for-**tapestry/<http://tawus.wordpress.com/2011/06/25/ajax-upload-for-tapestry/>
>>>>>>> Everything works fine but there is a strange problem. Sometimes the file
>>>>>>> uploaded is alwasy empty(size 0). I checked AjaxFileUploadDecoderImpl.**setupUploadedFile
>>>>>>> and suspected the problem is in TapestryInternalUtils.copy. So I tried to
>>>>>>> read the inputstream of the request myself. But strangely I always got
>>>>>>> return value -1 when I call the inputream.read when the problem happens.
>>>>>>> Looks the inputstream is totally empty. I checked the request sent by
>>>>>>> browser with firebug and can see the content is sent by post. Don't know
>>>>>>> why I just can not read it at server end.
>>>>>>> One more interesting thing is that, this problem only happens sometimes
>>>>>>> after tomcat6 is recycled. Fore example, I recycle tomcat 10 times and only
>>>>>>> get problem with 1 time. With that recycle, all the file upload fails. The
>>>>>>> problelm persists until I recycle tomcat again. With a good recycle, the
>>>>>>> problem doesn't happen at all. I tested this on several machines with
>>>>>>> different tomcat versions and see the same problem on all of them. I can
>>>>>>> not get any clue and hope someone could give me some light.  Thanks in
>>>>>>> advance.
>>>>>>> 
>>>>>>> 
>>>>>>> ------------------------------**------------------------------**---------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@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
>>>> 
>>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> 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


Re: Strange problem with Taha's AjaxUpload

Posted by Rural Hunter <ru...@gmail.com>.
How would that work? will it disable both filters? One way I figured out 
is: I changed the filter name and the AJAX_UPLOAD_HEADER in your code. I 
think it should work. am I right?

于 2012/9/1 18:19, Taha Siddiqi 写道:
> One way to handle it would be to contribute an override for "AjaxUploadFilter" to HttpServletRequestHandler with an empty implementation of HttpServletRequestFilter
>
> Some thing like
>
> public static void contributeHttpServletRequestHandler(final OrderedConfiguration<HttpServletRequestFilter> configuration,
>      final AjaxUploadDecoder ajaxUploadDecoder) {
>      configuration.override("AjaxUploadFilter", new EmptyHttpServletRequestImpl());
> }
>
> regards
> Taha
>
>
>
> On Sep 1, 2012, at 2:02 PM, Rural Hunter wrote:
>
>> Hi Taha,
>>
>> I used your comp first. Then other memeber in the team introduced tapestry-jquery later. besides, I do more like the appearance of your comp than he one in tapestry-jquery.
>>
>> 于 2012/9/1 14:29, Taha Hafeez Siddiqi 写道:
>>> If you are already using tapestry-jquery why not use it's own Ajaxupload component
>>>
>>> Sent from my iPhone
>>>
>>> On 01-Sep-2012, at 11:15 AM, Rural Hunter <ru...@gmail.com> wrote:
>>>
>>>> Yes, thanks. I found that tapestry-jquery in my classpath and it intercept the post request first sometimes. I'm wondering if there is any specific order the request flows among several request filter chain contributed into Tapestry HttpRequestHandler? From what I have seen, seems the order is random among every application starts but it's fixed once the application is started. is there any doc describe the order?
>>>>
>>>> 于 2012/9/1 6:08, Pavel Vodenski 写道:
>>>>> The stream can only be read once, so if you have another request filter
>>>>> running before the AjaxFileUploadDecoder you'll need to make sure that it
>>>>> did not read out the stream first.
>>>>>
>>>>> - P
>>>>>
>>>>> On Fri, Aug 31, 2012 at 3:02 AM, Rural Hunter <ru...@gmail.com> wrote:
>>>>>
>>>>>> I'm using Tapestry 5.3.3 and AjaxUpload comp blogged by Taha here:
>>>>>> http://tawus.wordpress.com/**2011/06/25/ajax-upload-for-**tapestry/<http://tawus.wordpress.com/2011/06/25/ajax-upload-for-tapestry/>
>>>>>> Everything works fine but there is a strange problem. Sometimes the file
>>>>>> uploaded is alwasy empty(size 0). I checked AjaxFileUploadDecoderImpl.**setupUploadedFile
>>>>>> and suspected the problem is in TapestryInternalUtils.copy. So I tried to
>>>>>> read the inputstream of the request myself. But strangely I always got
>>>>>> return value -1 when I call the inputream.read when the problem happens.
>>>>>> Looks the inputstream is totally empty. I checked the request sent by
>>>>>> browser with firebug and can see the content is sent by post. Don't know
>>>>>> why I just can not read it at server end.
>>>>>> One more interesting thing is that, this problem only happens sometimes
>>>>>> after tomcat6 is recycled. Fore example, I recycle tomcat 10 times and only
>>>>>> get problem with 1 time. With that recycle, all the file upload fails. The
>>>>>> problelm persists until I recycle tomcat again. With a good recycle, the
>>>>>> problem doesn't happen at all. I tested this on several machines with
>>>>>> different tomcat versions and see the same problem on all of them. I can
>>>>>> not get any clue and hope someone could give me some light.  Thanks in
>>>>>> advance.
>>>>>>
>>>>>>
>>>>>> ------------------------------**------------------------------**---------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@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
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> 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


Re: Strange problem with Taha's AjaxUpload

Posted by Taha Siddiqi <ta...@gmail.com>.
One way to handle it would be to contribute an override for "AjaxUploadFilter" to HttpServletRequestHandler with an empty implementation of HttpServletRequestFilter

Some thing like 

public static void contributeHttpServletRequestHandler(final OrderedConfiguration<HttpServletRequestFilter> configuration,
    final AjaxUploadDecoder ajaxUploadDecoder) {
    configuration.override("AjaxUploadFilter", new EmptyHttpServletRequestImpl());
}

regards
Taha



On Sep 1, 2012, at 2:02 PM, Rural Hunter wrote:

> Hi Taha,
> 
> I used your comp first. Then other memeber in the team introduced tapestry-jquery later. besides, I do more like the appearance of your comp than he one in tapestry-jquery.
> 
> 于 2012/9/1 14:29, Taha Hafeez Siddiqi 写道:
>> If you are already using tapestry-jquery why not use it's own Ajaxupload component
>> 
>> Sent from my iPhone
>> 
>> On 01-Sep-2012, at 11:15 AM, Rural Hunter <ru...@gmail.com> wrote:
>> 
>>> Yes, thanks. I found that tapestry-jquery in my classpath and it intercept the post request first sometimes. I'm wondering if there is any specific order the request flows among several request filter chain contributed into Tapestry HttpRequestHandler? From what I have seen, seems the order is random among every application starts but it's fixed once the application is started. is there any doc describe the order?
>>> 
>>> 于 2012/9/1 6:08, Pavel Vodenski 写道:
>>>> The stream can only be read once, so if you have another request filter
>>>> running before the AjaxFileUploadDecoder you'll need to make sure that it
>>>> did not read out the stream first.
>>>> 
>>>> - P
>>>> 
>>>> On Fri, Aug 31, 2012 at 3:02 AM, Rural Hunter <ru...@gmail.com> wrote:
>>>> 
>>>>> I'm using Tapestry 5.3.3 and AjaxUpload comp blogged by Taha here:
>>>>> http://tawus.wordpress.com/**2011/06/25/ajax-upload-for-**tapestry/<http://tawus.wordpress.com/2011/06/25/ajax-upload-for-tapestry/>
>>>>> Everything works fine but there is a strange problem. Sometimes the file
>>>>> uploaded is alwasy empty(size 0). I checked AjaxFileUploadDecoderImpl.**setupUploadedFile
>>>>> and suspected the problem is in TapestryInternalUtils.copy. So I tried to
>>>>> read the inputstream of the request myself. But strangely I always got
>>>>> return value -1 when I call the inputream.read when the problem happens.
>>>>> Looks the inputstream is totally empty. I checked the request sent by
>>>>> browser with firebug and can see the content is sent by post. Don't know
>>>>> why I just can not read it at server end.
>>>>> One more interesting thing is that, this problem only happens sometimes
>>>>> after tomcat6 is recycled. Fore example, I recycle tomcat 10 times and only
>>>>> get problem with 1 time. With that recycle, all the file upload fails. The
>>>>> problelm persists until I recycle tomcat again. With a good recycle, the
>>>>> problem doesn't happen at all. I tested this on several machines with
>>>>> different tomcat versions and see the same problem on all of them. I can
>>>>> not get any clue and hope someone could give me some light.  Thanks in
>>>>> advance.
>>>>> 
>>>>> 
>>>>> ------------------------------**------------------------------**---------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@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
>> 
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


Re: Strange problem with Taha's AjaxUpload

Posted by Rural Hunter <ru...@gmail.com>.
Hi Taha,

I used your comp first. Then other memeber in the team introduced 
tapestry-jquery later. besides, I do more like the appearance of your 
comp than he one in tapestry-jquery.

于 2012/9/1 14:29, Taha Hafeez Siddiqi 写道:
> If you are already using tapestry-jquery why not use it's own Ajaxupload component
>
> Sent from my iPhone
>
> On 01-Sep-2012, at 11:15 AM, Rural Hunter <ru...@gmail.com> wrote:
>
>> Yes, thanks. I found that tapestry-jquery in my classpath and it intercept the post request first sometimes. I'm wondering if there is any specific order the request flows among several request filter chain contributed into Tapestry HttpRequestHandler? From what I have seen, seems the order is random among every application starts but it's fixed once the application is started. is there any doc describe the order?
>>
>> 于 2012/9/1 6:08, Pavel Vodenski 写道:
>>> The stream can only be read once, so if you have another request filter
>>> running before the AjaxFileUploadDecoder you'll need to make sure that it
>>> did not read out the stream first.
>>>
>>> - P
>>>
>>> On Fri, Aug 31, 2012 at 3:02 AM, Rural Hunter <ru...@gmail.com> wrote:
>>>
>>>> I'm using Tapestry 5.3.3 and AjaxUpload comp blogged by Taha here:
>>>> http://tawus.wordpress.com/**2011/06/25/ajax-upload-for-**tapestry/<http://tawus.wordpress.com/2011/06/25/ajax-upload-for-tapestry/>
>>>> Everything works fine but there is a strange problem. Sometimes the file
>>>> uploaded is alwasy empty(size 0). I checked AjaxFileUploadDecoderImpl.**setupUploadedFile
>>>> and suspected the problem is in TapestryInternalUtils.copy. So I tried to
>>>> read the inputstream of the request myself. But strangely I always got
>>>> return value -1 when I call the inputream.read when the problem happens.
>>>> Looks the inputstream is totally empty. I checked the request sent by
>>>> browser with firebug and can see the content is sent by post. Don't know
>>>> why I just can not read it at server end.
>>>> One more interesting thing is that, this problem only happens sometimes
>>>> after tomcat6 is recycled. Fore example, I recycle tomcat 10 times and only
>>>> get problem with 1 time. With that recycle, all the file upload fails. The
>>>> problelm persists until I recycle tomcat again. With a good recycle, the
>>>> problem doesn't happen at all. I tested this on several machines with
>>>> different tomcat versions and see the same problem on all of them. I can
>>>> not get any clue and hope someone could give me some light.  Thanks in
>>>> advance.
>>>>
>>>>
>>>> ------------------------------**------------------------------**---------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@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
>
>


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


Re: Strange problem with Taha's AjaxUpload

Posted by Taha Hafeez Siddiqi <ta...@gmail.com>.
If you are already using tapestry-jquery why not use it's own Ajaxupload component 

Sent from my iPhone

On 01-Sep-2012, at 11:15 AM, Rural Hunter <ru...@gmail.com> wrote:

> Yes, thanks. I found that tapestry-jquery in my classpath and it intercept the post request first sometimes. I'm wondering if there is any specific order the request flows among several request filter chain contributed into Tapestry HttpRequestHandler? From what I have seen, seems the order is random among every application starts but it's fixed once the application is started. is there any doc describe the order?
> 
> 于 2012/9/1 6:08, Pavel Vodenski 写道:
>> The stream can only be read once, so if you have another request filter
>> running before the AjaxFileUploadDecoder you'll need to make sure that it
>> did not read out the stream first.
>> 
>> - P
>> 
>> On Fri, Aug 31, 2012 at 3:02 AM, Rural Hunter <ru...@gmail.com> wrote:
>> 
>>> I'm using Tapestry 5.3.3 and AjaxUpload comp blogged by Taha here:
>>> http://tawus.wordpress.com/**2011/06/25/ajax-upload-for-**tapestry/<http://tawus.wordpress.com/2011/06/25/ajax-upload-for-tapestry/>
>>> Everything works fine but there is a strange problem. Sometimes the file
>>> uploaded is alwasy empty(size 0). I checked AjaxFileUploadDecoderImpl.**setupUploadedFile
>>> and suspected the problem is in TapestryInternalUtils.copy. So I tried to
>>> read the inputstream of the request myself. But strangely I always got
>>> return value -1 when I call the inputream.read when the problem happens.
>>> Looks the inputstream is totally empty. I checked the request sent by
>>> browser with firebug and can see the content is sent by post. Don't know
>>> why I just can not read it at server end.
>>> One more interesting thing is that, this problem only happens sometimes
>>> after tomcat6 is recycled. Fore example, I recycle tomcat 10 times and only
>>> get problem with 1 time. With that recycle, all the file upload fails. The
>>> problelm persists until I recycle tomcat again. With a good recycle, the
>>> problem doesn't happen at all. I tested this on several machines with
>>> different tomcat versions and see the same problem on all of them. I can
>>> not get any clue and hope someone could give me some light.  Thanks in
>>> advance.
>>> 
>>> 
>>> ------------------------------**------------------------------**---------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@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


Re: Strange problem with Taha's AjaxUpload

Posted by Rural Hunter <ru...@gmail.com>.
Yes, thanks. I found that tapestry-jquery in my classpath and it 
intercept the post request first sometimes. I'm wondering if there is 
any specific order the request flows among several request filter chain 
contributed into Tapestry HttpRequestHandler? From what I have seen, 
seems the order is random among every application starts but it's fixed 
once the application is started. is there any doc describe the order?

于 2012/9/1 6:08, Pavel Vodenski 写道:
> The stream can only be read once, so if you have another request filter
> running before the AjaxFileUploadDecoder you'll need to make sure that it
> did not read out the stream first.
>
> - P
>
> On Fri, Aug 31, 2012 at 3:02 AM, Rural Hunter <ru...@gmail.com> wrote:
>
>> I'm using Tapestry 5.3.3 and AjaxUpload comp blogged by Taha here:
>> http://tawus.wordpress.com/**2011/06/25/ajax-upload-for-**tapestry/<http://tawus.wordpress.com/2011/06/25/ajax-upload-for-tapestry/>
>> Everything works fine but there is a strange problem. Sometimes the file
>> uploaded is alwasy empty(size 0). I checked AjaxFileUploadDecoderImpl.**setupUploadedFile
>> and suspected the problem is in TapestryInternalUtils.copy. So I tried to
>> read the inputstream of the request myself. But strangely I always got
>> return value -1 when I call the inputream.read when the problem happens.
>> Looks the inputstream is totally empty. I checked the request sent by
>> browser with firebug and can see the content is sent by post. Don't know
>> why I just can not read it at server end.
>> One more interesting thing is that, this problem only happens sometimes
>> after tomcat6 is recycled. Fore example, I recycle tomcat 10 times and only
>> get problem with 1 time. With that recycle, all the file upload fails. The
>> problelm persists until I recycle tomcat again. With a good recycle, the
>> problem doesn't happen at all. I tested this on several machines with
>> different tomcat versions and see the same problem on all of them. I can
>> not get any clue and hope someone could give me some light.  Thanks in
>> advance.
>>
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@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