Post a link to the JIRA if you create one. I think it's a good idea to allow the container to handle requests not handled by T5, but should be configurable and probably NOT the default. Perhaps web.xml would be the appropriate place to toggle this behavior.

Ritesh.S wrote:
Hello Davor,

Thanks for your help. I will try to implement the custom filter you
suggested.
Also I will post a JIRA if necessary.

Thanks once again...

From,
Ritesh S.



Davor Hrg wrote:
this is just a workaround,

you should post a JIRA about this problem,
there's been some talk about tapestry letting container deal with paths
that tapestry can not resolve ... so this may be fixed in current trunk...


here's something that might work, and
save you headaches before an official solution

add this to your pom

       <dependency>
          <groupId>javax.servlet</groupId>
          <artifactId>servlet-api</artifactId>
          <version>2.4</version>
          <scope>provided</scope>
        </dependency>


change web.xml

              <filter-class>mypackage.CustomFilter</filter-class>
              <!--filter-class>org.apache.tapestry.TapestryFilter
</filter-class-->


make this simple class that delegates most requests to tapestry filters


package mypackage;

import java.io.IOException;
import java.util.Enumeration;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;

import org.apache.tapestry.TapestryFilter;

public class CustomFilter implements Filter{
    TapestryFilter _delegate=new TapestryFilter();

    public void destroy() {
        _delegate.destroy();
    }

    public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
        HttpServletRequest req = (HttpServletRequest) request;
        String uri = req.getRequestURI();
        String contextPath = req.getContextPath();
        //dont know if this is needed
        //if(uri.startsWith(contextPath))
            uri = uri.substring(contextPath.length());
        if(uri.startsWith("/myignorepath")) chain.doFilter(request,
response);
        else
            _delegate.doFilter(request, response, chain);
    }

    public void init(FilterConfig filterConfig) throws ServletException {
        _delegate.init(filterConfig);
    }

}

modify the doFilter method to skip problematic paths



Davor Hrg




Reply via email to