Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4662945

Broken link due to {@docroot} not processed in package pages

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.1
    • 1.4.0
    • tools
    • hopper
    • x86
    • windows_2000



      Name: nt126004 Date: 04/04/2002


      FULL PRODUCT VERSION :
      java version "1.4.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
      Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

      FULL OPERATING SYSTEM VERSION :
      Microsoft Windows 2000 [Version 5.00.2195]

      A DESCRIPTION OF THE PROBLEM :
      This is not fixed by Bug Id 4460354.

      Cannot use standard approaches to create a link to the
      #package_description bookmark in the first sentence of a
      package-summary.html ("package") page, such that the link
      works both from the package page and the overview-
      summary.html ("overview") page.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. In the first sentence of a package.html page, try the
      syntax described in the Source Code section below.
      2.
      3.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      Expected: Relative link to bookmark on package page should
      work both from that package page and from the overview page.

      Actual: Depending on which syntax you use, one or the other
      ends up broken.

      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      I have tried a few approaches:
      -----------
      (1) Works on package-summary.html page, but tries to point to a local bookmark
      when it appears on the overview-summary.html page:

      <a href="#package_description">complete description</a>
      This is not fixed by Bug Id 4460354.

      -----------
      (2) Works on package-summary.html page, but not when link appears on overview-
      summary.html page:

      <a href="package-summary.html#package_description">complete description</a>
      This is not fixed by Bug Id 4460354.

      -----------
      (3) Works on package-summary.html page, but not when link appears on overview-
      summary.html page:

      <a href="{@docroot}package-summary.html#package_description">complete
      description</a> of this package.

      -----------
      (4) OPPOSITE: Works when link appears on overview-summary.html page, but not on
      package-summary.html page:

      Click the <a href="{@docroot}com/mydomain/mypackage/package-
      summary.html#package_description">complete description</a> of this package.

      -----------
      (5) This syntax does not work at all:
      {@link com.mydomain.mypackage#package_description}
      ---------- END SOURCE ----------

      CUSTOMER WORKAROUND :
      Write the URL so it will be relative when it appears on the
      overview page, and then use JavaScript to rewrite it on the
      package page:
      <a href="{@docroot}com/mydomain/mypackage/package-
      summary.html#package_description"
      onclick="this.href=adjustPath()">complete description</a>

      <script language="JavaScript"><!--
      /* Rewrites bookmark to be relative to this package page.
         Do not put this script into the HEAD element,
         as anything we put in there seems to be ignored by
         javadoc.
      */
         function adjustPath() {
            return "#package_description";
         }
      // --></script>
      (Review ID: 144814)
      ======================================================================

            dkramersunw Douglas Kramer (Inactive)
            nthompsosunw Nathanael Thompson (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: