broken error message (!) for header contribution
------------------------------------------------

                 Key: WICKET-1201
                 URL: https://issues.apache.org/jira/browse/WICKET-1201
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.3.0-rc1
            Reporter: Peter Ertl


I am working on wicket-trunk (revision 600547)

----------
HTML
-----------

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
<html xmlns:wicket="http://wicket.apache.org";>
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
  </head>
  <body>
    <span wicket:id="label">label</span>
  </body>
</html>

------------
CODE
------------

package test;

import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.internal.HtmlHeaderContainer;

public class TestPage extends WebPage
{
  public TestPage()
  {
    add(new Label("label", "testlabel")
    {
      @Override
      public void renderHead(final HtmlHeaderContainer container)
      {
        super.renderHead(container);
        container.getHeaderResponse().renderJavascript("alert(123)", "test");
      }
    });
  }
}

the above code sample will emit the following warning / error message:

4031 ERROR [btpool0-16] org.apache.wicket.markup.html.WebPage     - 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4031 ERROR [btpool0-16] org.apache.wicket.markup.html.WebPage     - You 
probably forgot to add a <body> tag to your markup since no Header Container 
was 
found but components where found which want to write to the <head> section.
<script type="text/javascript" id="test"><!--/*--><![CDATA[/*><!--*/
alert(123)
/*-->]]>*/</script>


4031 ERROR [btpool0-16] org.apache.wicket.markup.html.WebPage     - 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



I consider the above sample correct so this should be an error in wicket.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to