public String getHeaders ( ) { Map info = new TreeMap ( ) ; HttpServletRequest req = ( HttpServletRequest ) pageContext . getRequest ( ) ; Enumeration names = req . getHeaderNames ( ) ; while ( names . hasMoreElements ( ) ) { String name = ( String ) names . nextElement ( ) ; Enumeration values = req . getHeaders ( name ) ; StringBuffer sb = new StringBuffer ( ) ; boolean first = true ; while ( values . hasMoreElements ( ) ) { if ( ! first ) { sb . append ( " | " ) ; } first = false ; sb . append ( values . nextElement ( ) ) ; } info . put ( name , sb . toString ( ) ) ; } return toHTMLTable ( "headers" , info ) ; }
Returns a String with all header information as an HTML table .