if (structuredDocument == null)
return null;
String result = null;
// bascially same algorithm as get encoding or
// get content type from structuredDocument.
IJSPHeadContentDetector localHeadParser = getHeadParser();
// we can be assured that its already been
// parsed. If not call parseHeaderForPageDirective()
// before calling getLanguage;
localHeadParser.set(structuredDocument);
try {
result = localHeadParser.getLanguage();
}
catch (IOException e) {
// impossible
// TODO need to reconsider design to avoid
throw new Error(e);