You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Josh Chappelle <jc...@4redi.com> on 2012/03/02 05:26:16 UTC

Adding a header contribution as the first in the head tag

I'm trying to add an IE compatibility meta tag and it needs to be the first
item in the <head> tag otherwise it will not work. I have a BasePage that I
can just put it in the html and that works fine for the most part but I
would like a way to set it in the Application class that way any page will
get the contribution.

Is there any way to do this in wicket 1.5?

Thanks,

Josh

Re: Adding a header contribution as the first in the head tag

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

Assign this meta to a WebComponent.

html:
<head>
<meta wicket:id="blah" .../>

java:
WebComponent meta = new WebComponent("blah");
meta.add(new AttributeModifier("x", "y"))
add(meta);

On Fri, Mar 2, 2012 at 6:26 AM, Josh Chappelle <jc...@4redi.com> wrote:
> I'm trying to add an IE compatibility meta tag and it needs to be the first
> item in the <head> tag otherwise it will not work. I have a BasePage that I
> can just put it in the html and that works fine for the most part but I
> would like a way to set it in the Application class that way any page will
> get the contribution.
>
> Is there any way to do this in wicket 1.5?
>
> Thanks,
>
> Josh



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Adding a header contribution as the first in the head tag

Posted by jchappelle <jc...@4redi.com>.
Thanks! 

I was able to write an IResponseFilter and install it within my
Application.init via the method
getRequestCycleSettings().addResponseFilter(...).

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Adding-a-header-contribution-as-the-first-in-the-head-tag-tp4437445p4438773.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Adding a header contribution as the first in the head tag

Posted by Bas Gooren <ba...@iswd.nl>.
Josh,

You can use an application-wide IResponseFilter for this.
Have a look at how ServerHostNameAndTimeFilter (in wicket-examples (*)) 
does it.

*) E.g. look at 
http://grepcode.com/file/repo1.maven.org/maven2/org.apache.wicket/wicket-examples/1.5.3/org/apache/wicket/examples/ServerHostNameAndTimeFilter.java#ServerHostNameAndTimeFilter

Op 2-3-2012 5:26, schreef Josh Chappelle:
> I'm trying to add an IE compatibility meta tag and it needs to be the first
> item in the<head>  tag otherwise it will not work. I have a BasePage that I
> can just put it in the html and that works fine for the most part but I
> would like a way to set it in the Application class that way any page will
> get the contribution.
>
> Is there any way to do this in wicket 1.5?
>
> Thanks,
>
> Josh
>