You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by garz <ga...@gmx.net> on 2014/02/26 10:57:27 UTC
Why is using Tapestry a Filter instead of a Servlet
Hi,
i was just curious about why Tapestry is using a Filter instead of a Servlet. Does anyone know?
Regards
garz
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Why is using Tapestry a Filter instead of a Servlet
Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Wed, 26 Feb 2014 06:57:27 -0300, garz <ga...@gmx.net> wrote:
> Hi,
Hi!
> i was just curious about why Tapestry is using a Filter instead of a
> Servlet. Does anyone know?
As Lance said, a servlet is and endpoint and it must send a response to a
request. This causes servlets to be useless when you're trying to handle
more than one URL pattern but not all. A servlet filter is way more
flexible. You can have Tapestry code, specifically
HttpServletRequestFilter, which has a chance to run some logic for every
request, being it actually handled by Tapestry or not. One nice example
would be to control access to images (or any other URL) located in the
webapp context. You can do that in Tapestry even if the files are served
by the servlet container itself.
--
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: Why is using Tapestry a Filter instead of a Servlet
Posted by garz <ga...@gmx.net>.
thank you, thats it :)
On 26.02.2014, at 11:22, Lance Java <la...@googlemail.com> wrote:
> Well... You can have the Tapestry filter mapped to /* and it can play
> nicely with other servlets.
>
> http://tapestry.apache.org/configuration#Configuration-ConfiguringIgnoredPaths
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Why is using Tapestry a Filter instead of a Servlet
Posted by Lance Java <la...@googlemail.com>.
Well... You can have the Tapestry filter mapped to /* and it can play
nicely with other servlets.
http://tapestry.apache.org/configuration#Configuration-ConfiguringIgnoredPaths
Re: Why is using Tapestry a Filter instead of a Servlet
Posted by garz <ga...@gmx.net>.
yes i know that, but it does not answer my question. :)
On 26.02.2014, at 11:09, Lance Java <la...@googlemail.com> wrote:
> A filter is passed a reference to the FilterChain which can ultimately pass
> through to the servlet container's own url resolution (ie a resource in the
> war).
>
> A servlet is an endpoint and must resolve the URL itself.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Why is using Tapestry a Filter instead of a Servlet
Posted by Lance Java <la...@googlemail.com>.
A filter is passed a reference to the FilterChain which can ultimately pass
through to the servlet container's own url resolution (ie a resource in the
war).
A servlet is an endpoint and must resolve the URL itself.