Display JSP Variable to Console or Log

Ever wanted to display a JSP variable in your log or console? There is actually a pretty simple way to do this. Just add this code to your JSP. <c:set var=”debug”>${variabletoview}</c:set> <jsp:useBean id=”debug” type=”java.lang.String” /> <% System.out.println(“debug = “+debug); %>

List files in a directory using JSP

This JSP code will display a specified directory and all the files contained in that directory.  I used it to display a list of daily logs.   <jsp:include page=”../includes/header.jsp”> <jsp:param name=”report” value=”active”/> <jsp:param name=”title” value=”Your Title”/> </jsp:include> <!– ************************************************************************************************** –> <%! public void GetDirectory( String the_Path , Vector the_files , Vector the_folders ) { File c_Directory = new File( the_Path …