Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-2507

Inconsistent resource path using <wicket:link> and HeaderContributor after second request

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4.1, 1.4.2
    • 1.4.3, 1.5-M1
    • wicket
    • None

    Description

      In Wicket 1.4.1, 1.4.2 there is an inconsistency in rendering resource path (eg. for css) when we are using <wicket:link> tag in HTML and HeaderContributor in Java code.
      When we enter a page with a linked resource (using: <wicket:link>):
      ...
      <head>
      <title>Wicket Quickstart Archetype Homepage</title>
      <wicket:link>
      <link href="main.css" rel="stylesheet" type="text/css" media="screen, projection"/>
      </wicket:link>
      </head>
      ...

      for the very first time (after starting application), a link for main.css is rendered as:

      <link href="resources/com.mycompany.HomePage/main.css" rel="stylesheet" type="text/css" media="screen, projection"/>

      But after the second request this link is always rendered as:

      <link href="resources/com.mycompany.HomePage/main_locale.css" rel="stylesheet" type="text/css" media="screen, projection"/>

      where "_locale" is your current locale string (eg. "_pl", "_de", ...)
      So the locale string is appended to the resource path. In Wicket 1.3.6 the path is always without locale.
      You can try attached quickstart-app to see the difference.

      When we replace <wicket:link> in html, with CSSPackageResource.getHeaderContribution in code:

      add(CSSPackageResource.getHeaderContribution(HomePage.class, "main.css"));

      this link is always rendered as:

      <link rel="stylesheet" type="text/css" href="resources/com.mycompany.HomePage/main.css" />

      Well I think both ways: using <wicket:link> or header contribution in code, should produce always the same url path for resource and it should not contain "_locale" suffix (as in Wicket 1.3.6).

      Attachments

        1. wicket_link_testproject.zip
          8 kB
          Daniel Stoch

        Activity

          People

            jdonnerstag Juegen Donnerstag
            interface Daniel Stoch
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: