public void generateHTML(String viewId,String device,Document view,OutputStream out){
  try {
    StringWriter buff=new StringWriter();
    ViewParser viewParser=new ViewParser(viewId,device,false,mustIndent(),true);
    viewParser.generateHTMLHostPage(view,buff);
    String result=buff.toString();
    String outCharset=getOutputCharset();
    if (outCharset == null || outCharset.length() == 0) {
      throw new DeclarativeUITransformerException("Outputcharset is undefined. Check your web.xml file to ensure that DevModeInitializerListener is correctly configured.");
    }
    StreamUtils.write(new ByteArrayInputStream(result.getBytes(outCharset)),out,false);
  }
 catch (  Exception e) {
    log.error(e.getMessage(),e);
    throw new RuntimeException(e);
  }
}

public void generateHTML ( String viewId , String device , Document view , OutputStream out ) { try { StringWriter buff = new StringWriter ( ) ; ViewParser viewParser = new ViewParser ( viewId , device , false , mustIndent ( ) , true ) ; viewParser . generateHTMLHostPage ( view , buff ) ; String result = buff . toString ( ) ; String outCharset = getOutputCharset ( ) ; if ( outCharset == null || outCharset . length ( ) == 0 ) { throw new DeclarativeUITransformerException ( "Outputcharset is undefined. Check your web.xml file to ensure that DevModeInitializerListener is correctly configured." ) ; } StreamUtils . write ( new ByteArrayInputStream ( result . getBytes ( outCharset ) ) , out , false ) ; } catch ( Exception e ) { log . error ( e . getMessage ( ) , e ) ; throw new RuntimeException ( e ) ; } }
generate the html code from the view page .
