protected void writeFrameworkScript ( AbstractRenderAppender sb ) { boolean script = false ; ScriptRequestState jsu = ScriptRequestState . getScriptRequestState ( ( HttpServletRequest ) pageContext . getRequest ( ) ) ; boolean writeLegacy = false ; boolean writeName = false ; String val ; // if we are writing out legacy JavaScript support output the idMap if ( TagConfig . isLegacyJavaScript ( ) ) { val = processIdMap ( _idMap , "idMappingEntry" , _idScope ) ; if ( val != null ) { writeIdMap ( this , "idMappingTable" , val ) ; writeLegacy = true ; } } // if we are writing out default JavaScript support we create the name map if ( TagConfig . isDefaultJavaScript ( ) ) { String idScope = getJavaScriptId ( ) ; if ( idScope . equals ( "" ) ) idScope = null ; val = processIdMap ( _idToNameMap , "tagIdNameMappingEntry" , idScope ) ; if ( val != null ) { writeIdMap ( this , "tagIdNameMappingTable" , val ) ; writeName = true ; } } if ( writeLegacy || _writeId || writeName ) jsu . writeNetuiNameFunctions ( this , writeLegacy , _writeId , writeName ) ; ScriptTag . State state = null ; ScriptTag br = null ; if ( _funcBlocks != null && _funcBlocks . size ( ) > 0 ) { if ( ! script ) { state = new ScriptTag . State ( ) ; state . suppressComments = false ; br = ( ScriptTag ) TagRenderingBase . Factory . getRendering ( TagRenderingBase . SCRIPT_TAG , pageContext . getRequest ( ) ) ; br . doStartTag ( sb , state ) ; script = true ; } String s = ScriptRequestState . getString ( "functionComment" , null ) ; sb . append ( s ) ; int cnt = _funcBlocks . size ( ) ; for ( int i = 0 ; i < cnt ; i ++ ) { sb . append ( ( String ) _funcBlocks . get ( i ) ) ; if ( i != cnt - 1 ) { sb . append ( "\n" ) ; } } } if ( script ) { assert ( br != null ) ; br . doEndTag ( sb , false ) ; } }
This will write the script block .