/** * Returns a Sitemesh PageParser object with the <code>contentType</code> * specified, which by default is "text/html". * * @param contentType * @return */ protected PageParser getPageParser(String contentType) { Factory factory = getSitemeshFactory(); return factory.getPageParser(contentType == null ? "text/html" : contentType); }
public Content build(char[] data, SiteMeshContext context) throws IOException { HttpContentType httpContentType = new HttpContentType(context.getContentType()); PageParser pageParser = factory.getPageParser(httpContentType.getType()); Page page = pageParser.parse(data); return new HTMLPage2Content((HTMLPage) page); } }