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
}