I just found this out.  Thank you.


-----Original Message-----
From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] 
Sent: Friday, November 20, 2009 3:44 PM
To: users@wicket.apache.org
Subject: Re: Generating standards compliant responses

Try setting it in configureresponse()

-igor

On Friday, November 20, 2009, Loritsch, Berin C.
<berin.lorit...@gd-ais.com> wrote:
> I've set up in my SiteTemplate base class a call to set the content type
> for the response, however it is not making it to the browser.  Any
> ideas?  When I inspect the request headers and run the site validator
> against my page the server content type is set to "text/html" even
> though I've told it otherwise.  What am I missing here?  If it helps, it
> is hosted in Tomcat 6.  I need the "Content-Type" HTTP response header
> to return "application/xhtml+xml"
>
> public class SiteTemplate extends WebPage {
> //....
>         public void onBeforeRender() {
>
> super.getResponse().setContentType("application/xhtml+xml; utf-8");
>                 super.getResponse().setCharacterEncoding("utf-8");
>
>                 user = IMSSession.get().getUser();
>
>                 if (null == user && ! (this instanceof LoginPage)) {
>                         this.redirectToInterceptPage(new
> LoginPage(null));
>                 }
>
>                 if (get("content") == null) {
>                         BookmarkablePageLink<String> homeLink = new
> BookmarkablePageLink<String>("home",
> IMSApplication.get().getHomePage());
>                         homeLink.add(new ContextImage("logo",
> "images/logo.png"));
>                         add(homeLink);
>                         add(newUserInfo("userinfo"));
>                         add(newContentPanel("content"));
>                         add(newUserPanel("userbar"));
>                 }
>
>                 super.onBeforeRender();
>         }
> // .... define the newUserInfo, newContentPanel, and newUserPanel
> abstract methods
> }
>

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


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

Reply via email to