You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Francois Meillet <fr...@gmail.com> on 2015/07/23 18:45:33 UTC

error from WebPage # reportMissingHead

Hi Wicketers,

Use case :
-----------
on 'PageWithForm', after having filled the form, the user press a submit button.
A cookie has to be updated.
To trigger the update, a session attribute is set to false.

Then the user is redirected to a page : setResponsePage( new ResultPage() )
ResultPage extends Skeleton

In the Skeleton page, if the session attribute is set to false, the cookie is updated.
Then a NonResettingRestartException is thrown.


Problem:
-----------
When I throw a NonResettingRestartException() in a page where I also override renderHead()
I get an error from WebPage # reportMissingHead

You probably forgot to add a <body> or <head> tag to your markup since no Header Container was 
found but components were found which want to write to the <head> section.
<script type="text/javascript" src="./resource/org.apache.wicket.resource.JQueryResourceReference/jquery/jquery-1.11.3-ver-1435772778000.js"></script>
<link rel="canonical" href="https://localhost:8443/wicket/bookmarkable/com.quickstart.PageWithForm" />

but body and head tags are presents.

Environment:
-----------
WIcket 7.0.0-M6


Do you have any idea why ?
Thanks


Fran�ois



Re: error from WebPage # reportMissingHead

Posted by Francois Meillet <fr...@gmail.com>.
Thanks Sven

https://issues.apache.org/jira/browse/WICKET-5955


François 








Le 23 juil. 2015 à 22:44, Sven Meier <sv...@meiers.net> a écrit :

> Hi,
> 
> you're SkeletonPage is interrupting its normal page rendering (#onInitialize() being triggered late from WebPageRenderer).
> Thus in WebPage#validateHeaders() the page doesn't find its HtmlHeaderContainer, which it expects to exists already if rendering succeeded successfully.
> 
> So a) the error message is misleading and b) we may be able to improve this (e.g. checking #hasBeenRendered() before validating the headers).
> Please create a Jira issue for this.
> 
> For now you could just override #onConfigure() instead of #onInitialize().
> 
> Have fun
> Sven
> 
> 
> On 23.07.2015 18:45, Francois Meillet wrote:
>> Hi Wicketers,
>> 
>> Use case :
>> -----------
>> on 'PageWithForm', after having filled the form, the user press a submit button.
>> A cookie has to be updated.
>> To trigger the update, a session attribute is set to false.
>> 
>> Then the user is redirected to a page : setResponsePage( new ResultPage() )
>> ResultPage extends Skeleton
>> 
>> In the Skeleton page, if the session attribute is set to false, the cookie is updated.
>> Then a NonResettingRestartException is thrown.
>> 
>> 
>> Problem:
>> -----------
>> When I throw a NonResettingRestartException() in a page where I also override renderHead()
>> I get an error from WebPage # reportMissingHead
>> 
>> You probably forgot to add a <body> or <head> tag to your markup since no Header Container was
>> found but components were found which want to write to the <head> section.
>> <script type="text/javascript" src="./resource/org.apache.wicket.resource.JQueryResourceReference/jquery/jquery-1.11.3-ver-1435772778000.js"></script>
>> <link rel="canonical" href="https://localhost:8443/wicket/bookmarkable/com.quickstart.PageWithForm" />
>> 
>> but body and head tags are presents.
>> 
>> Environment:
>> -----------
>> WIcket 7.0.0-M6
>> 
>> 
>> Do you have any idea why ?
>> Thanks
>> 
>> 
>> François
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
> 


Re: error from WebPage # reportMissingHead

Posted by Sven Meier <sv...@meiers.net>.
Hi,

you're SkeletonPage is interrupting its normal page rendering 
(#onInitialize() being triggered late from WebPageRenderer).
Thus in WebPage#validateHeaders() the page doesn't find its 
HtmlHeaderContainer, which it expects to exists already if rendering 
succeeded successfully.

So a) the error message is misleading and b) we may be able to improve 
this (e.g. checking #hasBeenRendered() before validating the headers).
Please create a Jira issue for this.

For now you could just override #onConfigure() instead of #onInitialize().

Have fun
Sven


On 23.07.2015 18:45, Francois Meillet wrote:
> Hi Wicketers,
>
> Use case :
> -----------
> on 'PageWithForm', after having filled the form, the user press a submit button.
> A cookie has to be updated.
> To trigger the update, a session attribute is set to false.
>
> Then the user is redirected to a page : setResponsePage( new ResultPage() )
> ResultPage extends Skeleton
>
> In the Skeleton page, if the session attribute is set to false, the cookie is updated.
> Then a NonResettingRestartException is thrown.
>
>
> Problem:
> -----------
> When I throw a NonResettingRestartException() in a page where I also override renderHead()
> I get an error from WebPage # reportMissingHead
>
> You probably forgot to add a <body> or <head> tag to your markup since no Header Container was
> found but components were found which want to write to the <head> section.
> <script type="text/javascript" src="./resource/org.apache.wicket.resource.JQueryResourceReference/jquery/jquery-1.11.3-ver-1435772778000.js"></script>
> <link rel="canonical" href="https://localhost:8443/wicket/bookmarkable/com.quickstart.PageWithForm" />
>
> but body and head tags are presents.
>
> Environment:
> -----------
> WIcket 7.0.0-M6
>
>
> Do you have any idea why ?
> Thanks
>
>
> François
>
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org