Return-Path: X-Original-To: apmail-wicket-users-archive@minotaur.apache.org Delivered-To: apmail-wicket-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A692998B5 for ; Mon, 2 Apr 2012 06:58:16 +0000 (UTC) Received: (qmail 21286 invoked by uid 500); 2 Apr 2012 06:58:14 -0000 Delivered-To: apmail-wicket-users-archive@wicket.apache.org Received: (qmail 21092 invoked by uid 500); 2 Apr 2012 06:58:12 -0000 Mailing-List: contact users-help@wicket.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@wicket.apache.org Delivered-To: mailing list users@wicket.apache.org Received: (qmail 21068 invoked by uid 99); 2 Apr 2012 06:58:12 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Apr 2012 06:58:12 +0000 Received: from localhost (HELO mail-yw0-f45.google.com) (127.0.0.1) (smtp-auth username mgrigorov, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Apr 2012 06:58:11 +0000 Received: by yhoo21 with SMTP id o21so1165289yho.32 for ; Sun, 01 Apr 2012 23:58:10 -0700 (PDT) Received: by 10.236.178.65 with SMTP id e41mr5835169yhm.130.1333349890808; Sun, 01 Apr 2012 23:58:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.193.6 with HTTP; Sun, 1 Apr 2012 23:57:40 -0700 (PDT) In-Reply-To: References: From: Martin Grigorov Date: Mon, 2 Apr 2012 08:57:40 +0200 Message-ID: Subject: Re: Writing to header causes 'not yet working' code to be executed To: users@wicket.apache.org Content-Type: multipart/alternative; boundary=20cf3040e4d09a5dd304bcacb649 --20cf3040e4d09a5dd304bcacb649 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, Can you create a quickstart ? There is a special IMarkupFilter that creates automatically if you don't have one in your page markup. For some reason it seems it didn't work= . On Sun, Apr 1, 2012 at 11:16 PM, Chris Colman wrote: > ** ** > > I=E2=80=99ve overridden renderHead to write to the header of the page but= I get a > strange error message that I have not been able to work out. It executes > some code that has a =E2=80=98not implemented=E2=80=99 comment:**** > > ** ** > > The code is in WebPage:**** > > ** ** > > /****** > > * Validate that each component which wanted to contribute to > the header section actually was**** > > * able to do so.**** > > */**** > > private void validateHeaders()**** > > {**** > > // search for HtmlHeaderContainer in the first > level of children or deeper**** > > // if there are transparent resolvers used**** > > HtmlHeaderContainer header =3D visitChildren(new > IVisitor()**** > > {**** > > public void component(final Component > component, final IVisit visit)**** > > {**** > > if (component instanceof > HtmlHeaderContainer)**** > > {**** > > visit.stop(( > HtmlHeaderContainer)component);**** > > }**** > > else if (component > instanceof TransparentWebMarkupContainer =3D=3D false)**** > > {**** > > > visit.dontGoDeeper();**** > > }**** > > }**** > > });**** > > ** ** > > if (header =3D=3D null)**** > > {**** > > // the markup must at least contain a > tag for wicket to automatically**** > > // create a HtmlHeaderContainer. Log > an error if no header container**** > > // was created but any of the > components or behaviors want to contribute**** > > // something to the header.**** > > header =3D new HtmlHeaderContainer( > HtmlHeaderSectionHandler.HEADER_ID);**** > > add(header);**** > > ** ** > > Response orgResponse =3D getRequestCy= cle > ().getResponse();**** > > try**** > > {**** > > final StringResponserespo= nse =3D new > StringResponse();**** > > getRequestCycle(). > setResponse(response);**** > > ** ** > > // Render all header > sections of all components on the page**** > > > AbstractHeaderRenderStrategy.get().renderHeader(header, getPage());**** > > response.close();**** > > ** ** > > if (response.getBuffer().= length() > > 0)**** > > {**** > > // @TODO it > is not yet working properly. JDo to fix it**** > > log.error( > "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^= ^^^^^^^^^^^^^^^^^"); > **** > > log.error("Yo= u > probably forgot to add a or tag to your markup since no > Header Container was \n" +**** > > " > found but components were found which want to write to the > section.\n" +**** > > > response.getBuffer());**** > > log.error( > "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^= ^^^^^^^^^^^^^^^^^"); > **** > > }**** > > }**** > > catch (Exception e)**** > > {**** > > // just swallow this > exception, there isn't much we can do about.**** > > log.error("header/body > check throws exception", e);**** > > }**** > > finally**** > > {**** > > this.remove(header);**** > > getRequestCycle(). > setResponse(orgResponse);**** > > }**** > > }**** > > }**** > > ** ** > > Yours sincerely,**** > > ** ** > > Chris Colman**** > > **** > > Pagebloom Team Leader,**** > > Step Ahead Software > > **** > > pagebloom - your business & your website growing together**** > > ** ** > > **Sydney**: (+61 2) 9656 1278 ****Canberra****: (+61 2) 6100 2120 > **** > > Email: chrisc@stepahead.com.au **** > > Website:**** > > http://www.pagebloom.com**** > > http://develop.stepaheadsoftware.com**** > > **** > > ** ** > --=20 Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com --20cf3040e4d09a5dd304bcacb649--