You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Loritsch, Berin C." <Be...@gd-ais.com> on 2009/11/20 21:37:37 UTC
Generating standards compliant responses
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
}
RE: Generating standards compliant responses
Posted by "Loritsch, Berin C." <Be...@gd-ais.com>.
I just found this out. Thank you.
-----Original Message-----
From: Igor Vaynberg [mailto:igor.vaynberg@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.
<Be...@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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Generating standards compliant responses
Posted by Igor Vaynberg <ig...@gmail.com>.
Try setting it in configureresponse()
-igor
On Friday, November 20, 2009, Loritsch, Berin C.
<Be...@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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org