Click
  1. Click
  2. CLK-639

Click GAE does not support automapped pages in production modes

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.3.0-M1
    • Component/s: core
    • Labels:
      None

      Description

      Google App Engine does not seem to support looking up directories from the servlet context path. This in turn means Click cannot find the templates to build up a cached map of templates to Page classes.

      This problem only affects production and profile modes, not development modes, since development modes access the templates files directly (which GAE supports) if it fails to find it in the cached map.

      The workaround for now is to manually map Pages to templates in the click.xml file:

      <pages package="net.sf.clickclick.examples.jquery.page">
      <page path="home.htm" classname="HomePage" ></page>
      <page path="/ajax/form-demo.htm" classname="ajax.FormDemo"></page>
      ...
      </pages>

        Activity

        Bob Schellink made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Bob Schellink added a comment -

        Added automapping support for GAE with the caveat that page templates must be placed under the folders "page" or "pages"

        Show
        Bob Schellink added a comment - Added automapping support for GAE with the caveat that page templates must be placed under the folders "page" or "pages"
        Bob Schellink committed 964393 (3 files)
        Hide
        Bob Schellink added a comment -

        GAE does not properly implement the Servlet specification -> ServletContext.getResourcePaths("/").

        The Javadoc is quite explicit about the usage of "/":

        http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2/javax/servlet/ServletContext.html#getResourcePaths(java.lang.String)

        There is an outstanding issue raised with GAE:

        http://code.google.com/p/googleappengine/issues/detail?id=3417

        Even though GAE does not support getResourcePaths("/") it does return resources if the resourcePath is not root. For example getResourcePaths("/pages") does return resources under the folder "/pages".
        For now we can add a workaround where templates and pages must be placed under the "/pages" or "/page" folder. If Click determines it is running under GAE, it will scan these two folders explicitly for page templates.

        Show
        Bob Schellink added a comment - GAE does not properly implement the Servlet specification -> ServletContext.getResourcePaths("/"). The Javadoc is quite explicit about the usage of "/": http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2/javax/servlet/ServletContext.html#getResourcePaths(java.lang.String ) There is an outstanding issue raised with GAE: http://code.google.com/p/googleappengine/issues/detail?id=3417 Even though GAE does not support getResourcePaths("/") it does return resources if the resourcePath is not root. For example getResourcePaths("/pages") does return resources under the folder "/pages". For now we can add a workaround where templates and pages must be placed under the "/pages" or "/page" folder. If Click determines it is running under GAE, it will scan these two folders explicitly for page templates.
        Bob Schellink made changes -
        Field Original Value New Value
        Assignee Bob Schellink [ sabob ]
        Fix Version/s 2.3.0-M1 [ 12314845 ]
        Bob Schellink created issue -

          People

          • Assignee:
            Bob Schellink
            Reporter:
            Bob Schellink
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development