private ContentType findResponseContentType(Page page)
{
ComponentResources pageResources = page.getRootComponent().getComponentResources();
String contentTypeString = _metaDataLocator.findMeta(TapestryConstants.RESPONSE_CONTENT_TYPE, pageResources);
ContentType contentType = new ContentType(contentTypeString);
// Make sure thre's always a charset specified.
String encoding = contentType.getParameter(CHARSET);
if (encoding == null)
{
encoding = _metaDataLocator
.findMeta(TapestryConstants.RESPONSE_ENCODING, pageResources);
contentType.setParameter(CHARSET, encoding);
}
return contentType;
}