% /** * dateGenerator will look to a text file, grab info line my line, * and will generate the HTML for this page. * That way all I have to do is alter the text file. * I will also have greater flexibility to alter the look * of the page in a single place. * */ String strBaseDir = getServletContext().getRealPath(""); java.io.File filData = new java.io.File(strBaseDir + (java.io.File.separator) + "currentDates.txt"); java.io.BufferedReader ioReader = new java.io.BufferedReader( new java.io.FileReader(filData)); String strStyleClassName = "normal"; %>
<%=str%>
<% } } } catch(Exception e) { // ouch For now print to screen out.println(e.toString()); } finally { ioReader.close(); } /** * Don't forget to close the reader.... */ %>