title: Wicket 1.5 Javascript File in Body Tag
body: <p>I need to put a script-tag inside the body, because the javascript doesn't work in the head tag.</p>
  
  <p>As of Wicket 1.5 the following code is not longer supported:</p>
  
  <pre><code>add(new JavaScriptReference("wz_tooltip", new JavaScriptResourceReference(BaseTemplate.class, "wz_tooltip.js")));
  </code></pre>
  
  <p>This is because the class <code>JavaScriptReference</code> no longer exists.</p>
  
  <p>I can't obviously use the new <code>renderHead</code> method.</p>
  
  <p>My workaround so far:</p>
  
  <pre><code>WebMarkupContainer script = new WebMarkupContainer("script");
  script.add(new AttributeAppender("type", Model.of("text/javascript")));
  script.add(new AttributeAppender("src", Model.of("wz_tooltip.js")));
  add(script);
  </code></pre>
  
  <p>Really ugly apart from that it doesn't work; can't find the javascript files.</p>
  
  <p>Is there any other workaround or a "right" way to do it?</p>