I must agree with Christophe. With the current behavior, you are not able to
distinguish a page that doesn't exist.
This is awkward because being aware of incorrect pages access is common
request from professionals customers.


On Wed, Oct 7, 2009 at 2:27 PM, cordenier christophe <
christophe.corden...@gmail.com> wrote:

> I agree, but i think this behaviour 'should' be avoid if the index has not
> an activation method with the corresponding parameter length and type... A
> 404 should be automatically raised for this kind of request.
>
> 2009/10/7 Jan Jirout <jjir...@indracompany.com>
>
> > Hi,
> >
> > It seems that it works like this. If you access not existing page
> > http://localhost/demo/bla it's translated in to
> > http://localhost/demo/index/blah. I think that it's default behavior.
> >
> > Jan
> >
> >
> >
> > On Oct 7, 2009, at 10:24 AM, cordenier christophe wrote:
> >
> >  Hi
> >>
> >> From my humble point of view, using the activate method to send an error
> >> when page doesn't exist is not the right place. Imagine that you have
> >> subpackage with there own index page, you will have to duplicate your
> >> code.
> >>
> >> But your question is really pertinent, and I had a closer look at the
> >> ComponentEventLinkEncoder service which is used to identify pages during
> >> request dispatch. And it makes me ask another question :
> >>
> >> Why an URL like http://localhost/demo/blah (where demo is the context)
> is
> >> translated http://localhost/demo/index/blah where 'blah' become the
> >> activation context of the index even if there there is no activation
> >> method
> >> ?
> >>
> >> Does it mean that since we have an index page in our application, 404
> will
> >> never be thrown automatically ?
> >>
> >> Christophe.
> >>
> >> 2009/10/6 Kalle Korhonen <kalle.o.korho...@gmail.com>
> >>
> >>  Don't think I can help you much, but I can verify the same sendError
> >>> and error configurations work for me on Tomcat 5.5 (haven't tried on
> >>> Tomcat 6).
> >>>
> >>> Kalle
> >>>
> >>>
> >>> On Tue, Oct 6, 2009 at 3:05 AM, Jan Jirout <jjir...@indracompany.com>
> >>> wrote:
> >>>
> >>>> Hi All,
> >>>>
> >>>> I'm playing some time with t5. I have meet simple problem. I hope that
> >>>>
> >>> it's
> >>>
> >>>> not my fault.
> >>>>
> >>>> So.
> >>>>
> >>>> I would like to handle "Error 404" in my application so I have in
> >>>>
> >>> web.xml:
> >>>
> >>>>
> >>>>      <filter-mapping>
> >>>>              <filter-name>app</filter-name>
> >>>>              <url-pattern>/*</url-pattern>
> >>>>              <dispatcher>REQUEST</dispatcher>
> >>>>              <dispatcher>ERROR</dispatcher>
> >>>>      </filter-mapping>
> >>>>
> >>>>      <error-page>
> >>>>              <error-code>404</error-code>
> >>>>              <location>/error404</location>
> >>>>      </error-page>
> >>>>
> >>>>
> >>>> My Index.java is:
> >>>>
> >>>>
> >>>>  void onActivate(final String pageUrl) throws IOException {
> >>>>      if (isKnownPage(pageUrl)) {
> >>>>          //show page
> >>>>      } else {
> >>>>           response.sendError(404, null);
> >>>>      }
> >>>>  }
> >>>>
> >>>> If I access page "/hello"  then pageUrl property is "hello". If there
> is
> >>>> page /hello then this page is normally processed. If I sendError then
> >>>>
> >>> page
> >>>
> >>>> error404 should be shown. This Error page exists. So when I access
> /blah
> >>>> then /error404 page is shown. It works fine with jetty. But it doesn't
> >>>>
> >>> work
> >>>
> >>>> with tomcat 6.
> >>>>
> >>>> I have tried to debug it, and it seems to me, that information about
> >>>>
> >>> content
> >>>
> >>>> type is lost. In class BufferedGZipOutputStream is already information
> >>>>
> >>> about
> >>>
> >>>> content type lost but in class PageResponseRendererImpl is still
> >>>> present.
> >>>>
> >>>> thanks for help
> >>>>
> >>>> Jan
> >>>>
> >>>>
> >>>>
> >>>> Here is my stack trace:
> >>>> SEVERE: Servlet.service() for servlet default threw exception
> >>>> java.lang.NullPointerException
> >>>>      at
> >>>>
> >>>>
> org.apache.tapestry5.internal.services.ResponseCompressionAnalyzerImpl.isCompressable(ResponseCompressionAnalyzerImpl.java:65)
> >>>
> >>>>      at
> >>>>
> >>>>
> $ResponseCompressionAnalyzer_1241954ff2c.isCompressable($ResponseCompressionAnalyzer_1241954ff2c.java)
> >>>
> >>>>      at
> >>>>
> >>>>
> org.apache.tapestry5.internal.gzip.BufferedGZipOutputStream.openResponseOutputStream(BufferedGZipOutputStream.java:77)
> >>>
> >>>>      at
> >>>>
> >>>>
> org.apache.tapestry5.internal.gzip.BufferedGZipOutputStream.checkForCutover(BufferedGZipOutputStream.java:70)
> >>>
> >>>>      at
> >>>>
> >>>>
> org.apache.tapestry5.internal.gzip.BufferedGZipOutputStream.write(BufferedGZipOutputStream.java:116)
> >>>
> >>>>      at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202)
> >>>>      at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:263)
> >>>>      at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:106)
> >>>>      at java.io.OutputStreamWriter.write(OutputStreamWriter.java:190)
> >>>>      at java.io.BufferedWriter.flushBuffer(BufferedWriter.java:111)
> >>>>      at java.io.BufferedWriter.write(BufferedWriter.java:212)
> >>>>      at java.io.PrintWriter.write(PrintWriter.java:412)
> >>>>      at java.io.PrintWriter.write(PrintWriter.java:429)
> >>>>      at java.io.PrintWriter.print(PrintWriter.java:559)
> >>>>      at org.apache.tapestry5.dom.Text.toMarkup(Text.java:59)
> >>>>      at
> >>>> org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:840)
> >>>>      at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356)
> >>>>      at
> >>>> org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:840)
> >>>>      at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356)
> >>>>      at
> >>>> org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:840)
> >>>>      at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356)
> >>>>      at
> >>>> org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:840)
> >>>>      at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356)
> >>>>      at
> >>>> org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:840)
> >>>>      at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356)
> >>>>      at org.apache.tapestry5.dom.Document.toMarkup(Document.java:163)
> >>>>      at org.apache.tapestry5.dom.Node.toMarkup(Node.java:80)
> >>>>      at
> >>>>
> >>>>
> org.apache.tapestry5.internal.services.MarkupWriterImpl.toMarkup(MarkupWriterImpl.java:57)
> >>>
> >>>>      at
> >>>>
> >>>>
> org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:67)
> >>>
> >>>>      at
> >>>>
> >>>>
> $PageResponseRenderer_1241954ff57.renderPageResponse($PageResponseRenderer_1241954ff57.java)
> >>>
> >>>>      at
> >>>>
> >>>>
> org.apache.tapestry5.internal.services.DefaultRequestExceptionHandler.handleRequestException(DefaultRequestExceptionHandler.java:77)
> >>>
> >>>>      at
> >>>>
> >>>>
> $RequestExceptionHandler_1241954ff38.handleRequestException($RequestExceptionHandler_1241954ff38.java)
> >>>
> >>>>      at
> >>>>
> >>>>
> org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:42)
> >>>
> >>>>      at
> >>>> $RequestHandler_1241954ff3a.service($RequestHandler_1241954ff3a.java)
> >>>>      at
> >>>>
> >>>>
> org.apache.tapestry5.services.TapestryModule$4.service(TapestryModule.java:778)
> >>>
> >>>>      at
> >>>> $RequestHandler_1241954ff3a.service($RequestHandler_1241954ff3a.java)
> >>>>      at
> >>>>
> >>>>
> org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:767)
> >>>
> >>>>      at
> >>>> $RequestHandler_1241954ff3a.service($RequestHandler_1241954ff3a.java)
> >>>>      at
> >>>>
> >>>>
> org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:85)
> >>>
> >>>>      at
> >>>> $RequestHandler_1241954ff3a.service($RequestHandler_1241954ff3a.java)
> >>>>      at
> >>>>
> >>>>
> org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:90)
> >>>
> >>>>      at
> >>>>
> >>>>
> org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:81)
> >>>
> >>>>      at
> >>>>
> >>>>
> org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85)
> >>>
> >>>>      at
> >>>>
> >>>>
> org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:103)
> >>>
> >>>>      at
> >>>> $RequestHandler_1241954ff3a.service($RequestHandler_1241954ff3a.java)
> >>>>      at
> >>>> $RequestHandler_1241954ff2f.service($RequestHandler_1241954ff2f.java)
> >>>>      at
> >>>>
> >>>>
> org.apache.tapestry5.services.TapestryModule$HttpServletRequestHandlerTerminator.service(TapestryModule.java:197)
> >>>
> >>>>      at
> >>>>
> >>>>
> org.apache.tapestry5.upload.internal.services.MultipartServletRequestFilter.service(MultipartServletRequestFilter.java:44)
> >>>
> >>>>      at
> >>>>
> >>>>
> $HttpServletRequestHandler_1241954ff31.service($HttpServletRequestHandler_1241954ff31.java)
> >>>
> >>>>      at
> >>>>
> >>>>
> org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java:53)
> >>>>      at
> >>>>
> >>>>
> $HttpServletRequestHandler_1241954ff31.service($HttpServletRequestHandler_1241954ff31.java)
> >>>
> >>>>      at
> >>>>
> >>>>
> org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)
> >>>
> >>>>      at
> >>>>
> >>>>
> $HttpServletRequestFilter_1241954ff2d.service($HttpServletRequestFilter_1241954ff2d.java)
> >>>
> >>>>      at
> >>>>
> >>>>
> $HttpServletRequestHandler_1241954ff31.service($HttpServletRequestHandler_1241954ff31.java)
> >>>
> >>>>      at
> >>>>
> >>>>
> org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:726)
> >>>
> >>>>      at
> >>>>
> >>>>
> $HttpServletRequestHandler_1241954ff31.service($HttpServletRequestHandler_1241954ff31.java)
> >>>
> >>>>      at
> >>>>
> >>>>
> $HttpServletRequestHandler_1241954ff2b.service($HttpServletRequestHandler_1241954ff2b.java)
> >>>
> >>>>      at
> >>>> org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:127)
> >>>>      at
> >>>>
> >>>>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> >>>
> >>>>      at
> >>>>
> >>>>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> >>>
> >>>>      at
> >>>>
> >>>>
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
> >>>
> >>>>      at
> >>>>
> >>>>
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
> >>>
> >>>>      at
> >>>>
> >>>>
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
> >>>
> >>>>      at
> >>>>
> >>>>
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> >>>
> >>>>      at
> >>>>
> >>>>
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> >>>
> >>>>      at
> >>>>
> >>>>
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
> >>>
> >>>>      at
> >>>>
> >>>>
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
> >>>
> >>>>      at
> >>>>
> >>>>
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
> >>>
> >>>>      at
> >>>>
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
> >>>>      at java.lang.Thread.run(Thread.java:619)
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >>> For additional commands, e-mail: users-h...@tapestry.apache.org
> >>>
> >>>
> >>>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>

Reply via email to