Thanks Andreas,
it works!, but could you tell me why
<filter
before="tapestry.request.SetupRequestEncoding"
name="disableUrlSessionFilter"
object="service:jfly.webcommons.disableUrlSessionFilter"/>
is faster then the same filter without before ?
At least it seems to me!
On 4/18/07, Andreas Andreou <[EMAIL PROTECTED]> wrote:
For this, better use
http://tapestry.apache.org/tapestry4/tapestry/apidocs/org/apache/tapestry/services/ServletRequestServicerFilter.html
On 4/18/07, Andrea Chiumenti <[EMAIL PROTECTED]> wrote:
>
> As suggested by Andreas I've added this filter (
> http://randomcoder.com/articles/jsessionid-considered-harmful) to the
demo
> app, and now it's working.
>
> So I've decided to implement this solution in a more Tapestry fashion
and
> wrote the following class:
>
>
-----------------------------------------------------------------------------------------------------------
>
> public class DisableUrlSessionFilter implements
WebRequestServicerFilter{
> private HttpServletResponse response;
> private HttpServletRequest request;
>
> public void service(WebRequest webRequest, WebResponse webResponse,
> WebRequestServicer webRequestServicer) throws IOException {
> HttpServletResponseWrapper wrappedResponse = new
> HttpServletResponseWrapper(response) {
>
> public String encodeRedirectUrl(String url) {
> return url;
> }
> public String encodeRedirectURL(String url) {
> return url;
> }
> public String encodeUrl(String url) {
> return url;
> }
> public String encodeURL(String url) {
> return url;
> }
> };
>
> ServletWebResponse newResponse = new
> ServletWebResponse(wrappedResponse);
> webRequestServicer.service(webRequest, newResponse);
> }
>
> public HttpServletRequest getRequest() {
> return request;
> }
>
> public void setRequest(HttpServletRequest request) {
> this.request = request;
> }
>
> public HttpServletResponse getResponse() {
> return response;
> }
>
> public void setResponse(HttpServletResponse response) {
> this.response = response;
> }
> }
>
> -----------------------------------------------------------------
> Then I added to hive module the following lines:
> <contribution configuration-id="
> tapestry.request.WebRequestServicerPipeline
> ">
> <filter name="disableUrlSessionFilter" object="service:
> jfly.webcommons.disableUrlSessionFilter"/>
> </contribution>
>
> The problem is that it doesn't work as the filter because the jsessionid
> problem remains, so the HttpServletResponseWrapper encodeURL is never
> called.
>
> Why my WebRequestServicerFilter doesn't work ?
>
--
Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / JEE Consulting