1. Wicket
  2. WICKET-4425

Wicket 1.5 rewrites template content where it should not


    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.4
    • Fix Version/s: 1.5.5, 6.0.0-beta1
    • Component/s: wicket
    • Labels:


      I have recently upgraded from Wicket 1.4.14 to 1.5.4. One issue that I
      encountered is that <script> tags in panel templates are rewritten by
      Wicket, even when the <script> tags in question have no wicket handlers
      attached to them. I.e. the following panel template (notice that there
      are no wicket:id attributes whatsoever):

      <script id="template-upload" type="text/x-jquery-tmpl">


      Would render in the panel as:

      <script id="template-upload" type="text/x-jquery-tmpl">


      Imho this is unwanted behavior that is a regression from the behavior in
      Wicket 1.4.x (or at least 1.4.14). Wicket should not add content to the
      body of the script tags (or any other tags in a template, unless their
      content is provided programmatically), as it does not have the knowledge
      how that affects the functionality of the page. Moreover, the content
      that Wicket adds to these script tags is only correct for Javascript
      (hence incorrect for the scripts in the example as they are not
      javascript). In the above example adding /*, */
      will change the functionality of the script tag. If the "/<![CDATA[/"
      part was necessary in the script tags above, they should be added by the
      person that provides the template, not magically added by Wicket.

      I have attached a quickstart that demonstrates the issue. The quickstart has a <script id="script1">Some Text</script> element in HomePage.html that (by javascript) is shown in an alert box. Because of this bug, the alert will now start with "/<![CDATA[/", while it should simply show the text. See HomePage.html in the provided quickstart.

      1. WICKET-4425.patch
        1 kB
        Martin Grigorov
      2. myproject.zip
        26 kB

        Issue Links


          Pointbreak created issue -
          Pointbreak made changes -
          Field Original Value New Value
          Attachment myproject.zip [ 12515357 ]
          Martin Grigorov made changes -
          Link This issue is broken by WICKET-3420 [ WICKET-3420 ]
          Martin Grigorov made changes -
          Attachment WICKET-4425.patch [ 12515361 ]
          Martin Grigorov made changes -
          Assignee Martin Grigorov [ mgrigorov ]
          Martin Grigorov made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 1.5.5 [ 12319052 ]
          Fix Version/s 6.0.0 [ 12315431 ]
          Resolution Fixed [ 1 ]


            • Assignee:
              Martin Grigorov
            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created: