Velocity
  1. Velocity
  2. VELOCITY-551

IncludeNotFound event handler not including the "notfound" page

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: 1.6
    • Component/s: Engine
    • Labels:
      None
    • Environment:
      Linux (Fedora Core 5) / OSX 10.4.9
      Java 6
      Tomcat 6.0.10
      Struts2

      Description

      The IncludeNotFound event handler claims in the log "Can't find include not found
      page: " even though the "notfound" page exists.

      I've tracked this in the source:
      ------------------------------------------------
      boolean exists = (rs.getLoaderNameForResource(includeResourcePath) != null);
      if (!exists)
      {
      if (rs.getLoaderNameForResource(notfound) == null)

      { return notfound; }

      else

      { /** * can't find not found, so display nothing */ rs.getLog().error("Can't find include not found page: " + notfound); return null; }

      }
      else
      return includeResourcePath;
      ---------------------------------------------------

      I think the condition:

      if (rs.getLoaderNameForResource(notfound) == null)

      should read:

      if (rs.getLoaderNameForResource(notfound) != null)

      Changing this fixed the problem for me.

        Activity

        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12551509 ] jira [ 12552179 ]
        Mark Thomas made changes -
        Workflow jira [ 12405236 ] Default workflow, editable Closed status [ 12551509 ]
        Will Glass-Husain made changes -
        Field Original Value New Value
        Fix Version/s 1.6 [ 12310290 ]
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Michiel Toneman created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Michiel Toneman
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development