You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Doug Hauge <do...@lithium.com> on 2007/06/22 01:44:31 UTC

T5: Problems with Upload component interaction with non-Tapestry servlets

We are running Tapestry in a hybrid environment, where some pages are
handled by Tapestry and the rest are handled by a legacy servlet. We are
using the new Upload component, and are running into a problem where
requests with multipart content are processed by services installed by
the Upload component even if the page is not a Tapestry page, which
interferes with the processing of multipart content on our pages. What
seems to happen is

1) A request with multipart content is received
2) Control is passed to the Tapestry Filter
3) Before determining whether the request is for a tapestry page, the
MultipartServletRequestFilter process the request
4) The Tapestry Filter decides it does not recognize the page, and
passes the request on to our servlet
5) Our servlet tries to process the multipart request, but fails because
the request stream has already been read

We have a workaround where we turn our servlet into a filter that is
included before the Tapestry filter, but we run into the same problem in
reverse: our filter processes the multipart request before passing
control to the Tapestry filter, preventing it from being able to process
the multipart request. We can avoid the problem if we can recognize
whether we should pass control on to Tapestry before we process the
multipart request, but I do not know of a way to ask Tapestry if a URL
is for one of its pages (and doing the same for ours would be a bit of
work at this time). 

I guess there are two fundamental questions

1) Should Tapestry avoid having its handlers process a request until it
knows that it is processing a Tapestry page?
2) Is there a call we can make to determine whether Tapestry will handle
a given URL?

Thanks,
Doug

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


Re: T5: Problems with Upload component interaction with non-Tapestry servlets

Posted by Howard Lewis Ship <hl...@gmail.com>.
Please add an issue to JIRA and we'll fix this shortly.

On 6/21/07, Doug Hauge <do...@lithium.com> wrote:
> We are running Tapestry in a hybrid environment, where some pages are
> handled by Tapestry and the rest are handled by a legacy servlet. We are
> using the new Upload component, and are running into a problem where
> requests with multipart content are processed by services installed by
> the Upload component even if the page is not a Tapestry page, which
> interferes with the processing of multipart content on our pages. What
> seems to happen is
>
> 1) A request with multipart content is received
> 2) Control is passed to the Tapestry Filter
> 3) Before determining whether the request is for a tapestry page, the
> MultipartServletRequestFilter process the request
> 4) The Tapestry Filter decides it does not recognize the page, and
> passes the request on to our servlet
> 5) Our servlet tries to process the multipart request, but fails because
> the request stream has already been read
>
> We have a workaround where we turn our servlet into a filter that is
> included before the Tapestry filter, but we run into the same problem in
> reverse: our filter processes the multipart request before passing
> control to the Tapestry filter, preventing it from being able to process
> the multipart request. We can avoid the problem if we can recognize
> whether we should pass control on to Tapestry before we process the
> multipart request, but I do not know of a way to ask Tapestry if a URL
> is for one of its pages (and doing the same for ours would be a bit of
> work at this time).
>
> I guess there are two fundamental questions
>
> 1) Should Tapestry avoid having its handlers process a request until it
> knows that it is processing a Tapestry page?
> 2) Is there a call we can make to determine whether Tapestry will handle
> a given URL?
>
> Thanks,
> Doug
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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