Tapestry
  1. Tapestry
  2. TAPESTRY-1541

Can't find page with same name as parent folder

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.5
    • Fix Version/s: 5.0.7
    • Component/s: Framework
    • Labels:
      None

      Description

      It seems that if you have a directory with the same name as the page itself, Tapestry won't find that page.
      So, it won't find "pagetwo/PageTwo" but it will find "somepages/PageTwo".

        Activity

        Hide
        Howard M. Lewis Ship added a comment -

        Note that Tapestry now writes out to the console an "inventory" of pages (at startup), showing the mapping from logical name to class name.

        Show
        Howard M. Lewis Ship added a comment - Note that Tapestry now writes out to the console an "inventory" of pages (at startup), showing the mapping from logical name to class name.
        Hide
        Howard M. Lewis Ship added a comment -

        My approach is that, if the result of stripping off terms results in the empty string, then we leave the simple name alone.

        For example, foo.pages.admin.product.AdminProduct will convert to admin/product/AdminProduct.

        Show
        Howard M. Lewis Ship added a comment - My approach is that, if the result of stripping off terms results in the empty string, then we leave the simple name alone. For example, foo.pages.admin.product.AdminProduct will convert to admin/product/AdminProduct.
        Hide
        Ted Steen added a comment -

        It will work if you add a trailing "/"

        http://issues.apache.org/jira/browse/TAPESTRY-1769 is the real problem in my opinion.

        I think of this more as a feature.
        It enables you to create an index-like page for a package.

        If you give your page the same name as your package "pages/product/Product.java"
        then you will be able to access it with http://host/product/
        and I think it also should be possible to access it with http://host/product

        Show
        Ted Steen added a comment - It will work if you add a trailing "/" http://issues.apache.org/jira/browse/TAPESTRY-1769 is the real problem in my opinion. I think of this more as a feature. It enables you to create an index-like page for a package. If you give your page the same name as your package "pages/product/Product.java" then you will be able to access it with http://host/product/ and I think it also should be possible to access it with http://host/product
        Hide
        Steven Coco added a comment -

        This might be useful additional information on this issue:

        I think I have found another side-effect of this same bug. In order to work around it, I had decided to stick with my naming choices and just move the page "Any" out of it's subdirectory: so from "/any/Any" to "/Any". This works, and I can make page links to "Any". However if I then also put in the subdirectory ("/any") and try to put other pages in there, like /any/Continued", Tap fails to recognize these pages. It seems the "Any" page is now hiding the entire "any" subdirectory path.

        Now this might be some kind of expected behavior: it might just be preventing me from using my indicated workaround to temporarily evade the bug. But it's happening none the less, so I thought I should add the comment at least.

        Thanks...

        Show
        Steven Coco added a comment - This might be useful additional information on this issue: I think I have found another side-effect of this same bug. In order to work around it, I had decided to stick with my naming choices and just move the page "Any" out of it's subdirectory: so from "/any/Any" to "/Any". This works, and I can make page links to "Any". However if I then also put in the subdirectory ("/any") and try to put other pages in there, like /any/Continued", Tap fails to recognize these pages. It seems the "Any" page is now hiding the entire "any" subdirectory path. Now this might be some kind of expected behavior: it might just be preventing me from using my indicated workaround to temporarily evade the bug. But it's happening none the less, so I thought I should add the comment at least. Thanks...

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Hugo Palma
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development