String getHTMLForAdminPage ( Map < String , String > params ) { try { String template = m_htmlTemplates . get ( "admintemplate.html" ) ; for ( Entry < String , String > e : params . entrySet ( ) ) { String key = e . getKey ( ) . toUpperCase ( ) ; String value = e . getValue ( ) ; if ( key == null ) continue ; if ( value == null ) value = "NULL" ; template = template . replace ( "#" + key + "#" , value ) ; } return template ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return "<html><body>An unrecoverable error was encountered while generating this page.</body></html>" ; }
Load a template for the admin page fill it out and return the value .