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

On Dec 4, 2007 12:44 PM, Ritesh.S <[EMAIL PROTECTED]> wrote:

>
>
> Hello Davor,
> Thanks for your reply. I am giving stack trace below and problematic url.
>
> Following is the stack trace I get when I try to upload a file through the
> servlet
> which produces the .htm file and shows in url.
>
> This occures when use <url-pattern>/*<url-pattern>
>
> An unexpected application exception has occurred.
>
>    * java.lang.IllegalArgumentException
>      Unable to resolve page 'document/DocumentUpload' to a known page
> name.
> Available page names: core/ExceptionReport, core/PropertyDisplayBlocks,
> core/PropertyEditBlocks, resource/AssignmentSummary, resource/Business,
> resource/Dashboard, resource/GenericSelectModel,
> resource/ManageResourcesList, resource/Personal, resource/Projects,
> resource/Remaining, resource/Select, resource/SelectResource_V8_5,
> resource/TaskAssignmentDetail, resource/ViewDetails,
> resource/ViewDetails_V8_5, resource/ViewSummary.
>
>      Stack trace
>              o
> org.apache.tapestry.internal.services.ComponentClassResolverImpl$8.invoke(
> ComponentClassResolverImpl.java:393)
>              o
> org.apache.tapestry.internal.services.ComponentClassResolverImpl$8.invoke(
> ComponentClassResolverImpl.java:388)
>              o
> org.apache.tapestry.ioc.internal.util.ConcurrentBarrier.withRead(
> ConcurrentBarrier.java:77)
>              o
>
> org.apache.tapestry.internal.services.ComponentClassResolverImpl.canonicalizePageName
> (ComponentClassResolverImpl.java:386)
>              o
> org.apache.tapestry.internal.services.PagePoolImpl.checkout(
> PagePoolImpl.java:59)
>              o
> org.apache.tapestry.internal.services.RequestPageCacheImpl.get(
> RequestPageCacheImpl.java:44)
>              o
>
> org.apache.tapestry.internal.services.RequestEncodingInitializerImpl.initializeRequestEncoding
> (RequestEncodingInitializerImpl.java:42)
>              o
> org.apache.tapestry.internal.services.InternalModule$11.handle(
> InternalModule.java:539)
>              o
> org.apache.tapestry.internal.services.ComponentActionDispatcher.dispatch(
> ComponentActionDispatcher.java:116)
>              o
> org.apache.tapestry.services.TapestryModule$12.service(TapestryModule.java
> :1066)
>              o
> org.apache.tapestry.internal.services.LocalizationFilter.service(
> LocalizationFilter.java:43)
>              o
> org.apache.tapestry.services.TapestryModule$2.service(TapestryModule.java
> :657)
>              o
> org.apache.tapestry.internal.services.StaticFilesFilter.service(
> StaticFilesFilter.java:63)
>              o
> org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke(
> CheckForUpdatesFilter.java:97)
>              o
> org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke(
> CheckForUpdatesFilter.java:88)
>              o
> org.apache.tapestry.ioc.internal.util.ConcurrentBarrier.withRead(
> ConcurrentBarrier.java:77)
>              o
> org.apache.tapestry.internal.services.CheckForUpdatesFilter.service(
> CheckForUpdatesFilter.java:110)
>              o
> org.apache.tapestry.services.TapestryModule$11.service(TapestryModule.java
> :1044)
>              o
> org.apache.tapestry.TapestryFilter.doFilter(TapestryFilter.java:135)
>              o
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:215)
>              o
> org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:188)
>              o
> net.project.security.SessionAccessFilter.doFilter(SessionAccessFilter.java
> :79)
>              o
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:215)
>              o
> org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:188)
>              o
> org.apache.catalina.core.StandardWrapperValve.invoke(
> StandardWrapperValve.java:210)
>              o
> org.apache.catalina.core.StandardContextValve.invoke(
> StandardContextValve.java:174)
>              o
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
> :127)
>              o
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
> :117)
>              o
> org.apache.catalina.core.StandardEngineValve.invoke(
> StandardEngineValve.java:108)
>              o
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java
> :151)
>              o
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
>              o
>
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
> (Http11BaseProtocol.java:665)
>              o
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
> PoolTcpEndpoint.java:528)
>              o
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
> LeaderFollowerWorkerThread.java:81)
>              o
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
> ThreadPool.java:685)
>              o java.lang.Thread.run(Unknown Source)
>
> But when I use <url-pattern>/package/*</url-pattern> the file uploading
> dont
> show any exception
> and Tapestry pages also executes well but with -[Error]- in front of every
> tapestry component
> Actually -[Error]- is alt text for error image of tapestry which gets
> displayed on validation error.
> But I don't know why it gets activated in this situation.
>
> If anyone can tell why this is happening it will be very helpful to me. :>
>
> Thanks in advance.. :)
>
> Davor Hrg wrote:
> >
> > could you post stack trace,
> > and problematic url ?
> >
> > Davor Hrg
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/T5%3A-%3Curl-pattern%3E-problem-in-web.xml-tf4942242.html#a14149099
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to