• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None
    • Platform: All, OS: All

      views/lib/layout/layout.jelly includes

      <title>${title}</title>

      yet the generated HTML has just

      <title></title>

      Apparently this var is not getting substituted.

          [JENKINS-112] Blank page titles

          I guess the intention is that <layout> tag is suppsoed to be written like:

          <l:layout title="...">

          but looks like none of them have the title attribute. Would you be able to pitch
          in on this one?

          Kohsuke Kawaguchi added a comment - I guess the intention is that <layout> tag is suppsoed to be written like: <l:layout title="..."> but looks like none of them have the title attribute. Would you be able to pitch in on this one?

          Jesse Glick added a comment -

          Did Hudson ever have page titles? I don't remember.

          Should start by making ${title} default to Hudson, I guess. But I don't know any
          Jelly at all, would have to look it up.

          Jesse Glick added a comment - Did Hudson ever have page titles? I don't remember. Should start by making ${title} default to Hudson, I guess. But I don't know any Jelly at all, would have to look it up.

          I think it would be nice if title reflects individual pages — like "myproject
          #125 - Hudson" or something like that. We can put a logic in layout.jelly to put
          a common suffix like " - Hudson".

          Jelly is mostly like JSP. Think of those lib/*/.jelly as tag files, and other
          jelly script as JSP pages.

          Kohsuke Kawaguchi added a comment - I think it would be nice if title reflects individual pages — like "myproject #125 - Hudson" or something like that. We can put a logic in layout.jelly to put a common suffix like " - Hudson". Jelly is mostly like JSP. Think of those lib/* / .jelly as tag files, and other jelly script as JSP pages.

          Jesse Glick added a comment -

          OK.

          Jesse Glick added a comment - OK.

          Jesse Glick added a comment -

          JEXL docs claims it supports the ternary conditional but they lie.

          https://issues.apache.org/jira/browse/JEXL-19

          Jesse Glick added a comment - JEXL docs claims it supports the ternary conditional but they lie. https://issues.apache.org/jira/browse/JEXL-19

          Jesse Glick added a comment -

          Fixed for the most common pages (that I use): dashboard, project, build,
          changes, console. I was unable to coerce JEXL into providing a default page title.

          Checking in views/hudson/model/Build/changes.jelly;
          /shared/data/ccvs/repository/hudson/hudson/views/hudson/model/Build/changes.jelly,v
          <-- changes.jelly
          new revision: 1.4; previous revision: 1.3
          done
          Checking in views/hudson/model/Build/index.jelly;
          /shared/data/ccvs/repository/hudson/hudson/views/hudson/model/Build/index.jelly,v
          <-- index.jelly
          new revision: 1.5; previous revision: 1.4
          done
          Checking in views/hudson/model/Hudson/log.jelly;
          /shared/data/ccvs/repository/hudson/hudson/views/hudson/model/Hudson/log.jelly,v
          <-- log.jelly
          new revision: 1.2; previous revision: 1.1
          done
          Checking in views/hudson/model/Hudson/manage.jelly;
          /shared/data/ccvs/repository/hudson/hudson/views/hudson/model/Hudson/manage.jelly,v
          <-- manage.jelly
          new revision: 1.4; previous revision: 1.3
          done
          Checking in views/hudson/model/Job/index.jelly;
          /shared/data/ccvs/repository/hudson/hudson/views/hudson/model/Job/index.jelly,v
          <-- index.jelly
          new revision: 1.4; previous revision: 1.3
          done
          Checking in views/hudson/model/JobCollection/index.jelly;
          /shared/data/ccvs/repository/hudson/hudson/views/hudson/model/JobCollection/index.jelly,v
          <-- index.jelly
          new revision: 1.4; previous revision: 1.3
          done
          Checking in views/hudson/model/Run/artifacts-index.jelly;
          /shared/data/ccvs/repository/hudson/hudson/views/hudson/model/Run/artifacts-index.jelly,v
          <-- artifacts-index.jelly
          new revision: 1.3; previous revision: 1.2
          done
          Checking in views/hudson/model/Run/console.jelly;
          /shared/data/ccvs/repository/hudson/hudson/views/hudson/model/Run/console.jelly,v
          <-- console.jelly
          new revision: 1.6; previous revision: 1.5
          done
          Checking in views/lib/layout/layout.jelly;
          /shared/data/ccvs/repository/hudson/hudson/views/lib/layout/layout.jelly,v <--
          layout.jelly
          new revision: 1.4; previous revision: 1.3
          done
          Checking in www/changelog.html;
          /shared/data/ccvs/repository/hudson/www/changelog.html,v <-- changelog.html
          new revision: 1.171; previous revision: 1.170
          done

          Jesse Glick added a comment - Fixed for the most common pages (that I use): dashboard, project, build, changes, console. I was unable to coerce JEXL into providing a default page title. Checking in views/hudson/model/Build/changes.jelly; /shared/data/ccvs/repository/hudson/hudson/views/hudson/model/Build/changes.jelly,v <-- changes.jelly new revision: 1.4; previous revision: 1.3 done Checking in views/hudson/model/Build/index.jelly; /shared/data/ccvs/repository/hudson/hudson/views/hudson/model/Build/index.jelly,v <-- index.jelly new revision: 1.5; previous revision: 1.4 done Checking in views/hudson/model/Hudson/log.jelly; /shared/data/ccvs/repository/hudson/hudson/views/hudson/model/Hudson/log.jelly,v <-- log.jelly new revision: 1.2; previous revision: 1.1 done Checking in views/hudson/model/Hudson/manage.jelly; /shared/data/ccvs/repository/hudson/hudson/views/hudson/model/Hudson/manage.jelly,v <-- manage.jelly new revision: 1.4; previous revision: 1.3 done Checking in views/hudson/model/Job/index.jelly; /shared/data/ccvs/repository/hudson/hudson/views/hudson/model/Job/index.jelly,v <-- index.jelly new revision: 1.4; previous revision: 1.3 done Checking in views/hudson/model/JobCollection/index.jelly; /shared/data/ccvs/repository/hudson/hudson/views/hudson/model/JobCollection/index.jelly,v <-- index.jelly new revision: 1.4; previous revision: 1.3 done Checking in views/hudson/model/Run/artifacts-index.jelly; /shared/data/ccvs/repository/hudson/hudson/views/hudson/model/Run/artifacts-index.jelly,v <-- artifacts-index.jelly new revision: 1.3; previous revision: 1.2 done Checking in views/hudson/model/Run/console.jelly; /shared/data/ccvs/repository/hudson/hudson/views/hudson/model/Run/console.jelly,v <-- console.jelly new revision: 1.6; previous revision: 1.5 done Checking in views/lib/layout/layout.jelly; /shared/data/ccvs/repository/hudson/hudson/views/lib/layout/layout.jelly,v <-- layout.jelly new revision: 1.4; previous revision: 1.3 done Checking in www/changelog.html; /shared/data/ccvs/repository/hudson/www/changelog.html,v <-- changelog.html new revision: 1.171; previous revision: 1.170 done

          Jesse Glick added a comment -

          Kohsuke writes:

          --%<--
          Meanwhile, we can use h.ifThenElse(testExpr,thenExpr,elseExpr) where h
          is an object added to the context in layout.jelly — see Functions.java
          for the definition of all the other methods on "h".

          This is a function call and thus all three expressions always get
          evaluated, but most of the time this behavior is acceptable.
          --%<--

          Artifacts page does not get a title for some reason; apparently
          views/hudson/model/Run/artifacts-index.jelly is not being used for this.

          Log file has many NPEs of the form:

          --%<--
          Sep 11, 2006 4:32:24 PM org.apache.commons.jelly.expression.jexl.JexlExpression
          evaluate
          WARNING: Caught exception evaluating: title + ' [Hudson]'. Reason:
          java.lang.NullPointerException
          java.lang.NullPointerException
          at org.apache.commons.jexl.parser.ASTAddNode.value(ASTAddNode.java:116)
          [....]
          at
          org.kohsuke.stapler.jelly.JellyRequestDispatcher.forward(JellyRequestDispatcher.java:29)
          at hudson.model.DirectoryHolder.serveFile(DirectoryHolder.java:84)
          at hudson.model.Run.doArtifact(Run.java:579)
          [....]
          --%<--

          Jesse Glick added a comment - Kohsuke writes: -- %< -- Meanwhile, we can use h.ifThenElse(testExpr,thenExpr,elseExpr) where h is an object added to the context in layout.jelly — see Functions.java for the definition of all the other methods on "h". This is a function call and thus all three expressions always get evaluated, but most of the time this behavior is acceptable. -- %< -- Artifacts page does not get a title for some reason; apparently views/hudson/model/Run/artifacts-index.jelly is not being used for this. Log file has many NPEs of the form: -- %< -- Sep 11, 2006 4:32:24 PM org.apache.commons.jelly.expression.jexl.JexlExpression evaluate WARNING: Caught exception evaluating: title + ' [Hudson] '. Reason: java.lang.NullPointerException java.lang.NullPointerException at org.apache.commons.jexl.parser.ASTAddNode.value(ASTAddNode.java:116) [....] at org.kohsuke.stapler.jelly.JellyRequestDispatcher.forward(JellyRequestDispatcher.java:29) at hudson.model.DirectoryHolder.serveFile(DirectoryHolder.java:84) at hudson.model.Run.doArtifact(Run.java:579) [....] -- %< --

          Jesse Glick added a comment -

          Better fixes:

          1.19 src/hudson/Functions.java
          1.11 src/hudson/model/DirectoryHolder.java
          1.4 views/hudson/model/DirectoryHolder/dir.jelly
          1.5 views/lib/layout/layout.jelly

          Jesse Glick added a comment - Better fixes: 1.19 src/hudson/Functions.java 1.11 src/hudson/model/DirectoryHolder.java 1.4 views/hudson/model/DirectoryHolder/dir.jelly 1.5 views/lib/layout/layout.jelly

            jglick Jesse Glick
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: