Click
  1. Click
  2. CLK-738

Provide a mechanism to map Page classes in specific package to a particular URL path

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Not a Problem
    • Affects Version/s: 2.4.0
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None

      Description

      It will be good if there is a mechanism to map Page classes within a particular package to a specific URL.
      For example, I have Page classes sitting in the following packages:

      com.mycorp.page.admin
      com.mycorp.page.workspace
      com.mycorp.page.public

      I would like to be able to configure the following mapping:

      /secured/user_admin.htm --> com.mycorp.page.admin.UserAdminPage.java
      /secured/workspace_admin.htm --> com.mycorp.page.admin.WorkspaceAdminPage.java
      /secured/workspace_dashboard.htm --> com.mycorp.page.workspace.WorkspaceDashboardPage.java
      /public_notice.htm --> com.mycorp.page.public.PublicNoticePage.htm

      So basically, I would like to map all the pages in 'com.mycorp.page.admin' and 'com.mycorp.page.workspace' to the path '/secured',
      and map all the pages in 'com.mycorp.page.public' to the root directory of the webapp.

      By doing so, this would provide me the following benefits:
      1. Maintain independence between the URL path and the package structure
      2. Easily configure security framework such as Shiro or Acegi to protect URL path

        Activity

        Hide
        Gilberto C Andrade added a comment -

        What stops you to map them manually when the automapping [1] is not enough?

        Gilberto

        [1]http://click.apache.org/docs/user-guide/htmlsingle/click-book.html#application-automapping

        Show
        Gilberto C Andrade added a comment - What stops you to map them manually when the automapping [1] is not enough? Gilberto [1] http://click.apache.org/docs/user-guide/htmlsingle/click-book.html#application-automapping
        Hide
        Bob Schellink added a comment -

        Manual mapping has always been supported in Click. See the first mapping here: http://click.apache.org/docs/user-guide/html/ch05s02.html#application-automapping

        You can also implement your own ConfigService to completely change the mapping algorithm.

        Show
        Bob Schellink added a comment - Manual mapping has always been supported in Click. See the first mapping here: http://click.apache.org/docs/user-guide/html/ch05s02.html#application-automapping You can also implement your own ConfigService to completely change the mapping algorithm.

          People

          • Assignee:
            Unassigned
            Reporter:
            Han
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development