Uploaded image for project: 'Click'
  1. Click
  2. CLK-561

Page#setForward(Class) silently fails for a non-existing .htm

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.1.0
    • Fix Version/s: 3.0.0
    • Component/s: core
    • Labels:
      None

      Description

      When setting a forward in a page, and the corresponding .htm is missing, Page#setForward(Class) will silently fail, and Page#getForward() will return null. Eventually, you will remain on the current page, since ClickServlet wasn't told otherwise.

      Example:
      IndexPage.java
      ...
      public boolean onLogin() {
      ...
      if ( isLoggedIn )

      { setForward(HomePage.class); return false; }

      ...
      }

      If home.htm is missing, setForward will set the forward field to null, while I would expect it to barf with an IllegalArgumentException. The javadoc of ConfigService#getPagePath(Class) also says: "@throws IllegalArgumentException if the Page Class is not configured"

      Proposed solution:
      Instead of returning null in XmlConfigService#getPagePage(Class), throw an IAE.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              surfman WarnerJan Veldhuis
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: