<%@ page import="java.io.*" %> <%@ include file ="../include/common.jsp"%> Printing... <% String thisLine; int start, intStartCheck, intEndCheck, startTable, endTable, statusTable; String filePath = gbl_dir + "health_info/disease_information/asthma/"; int fileCount = 13; String[] fileName = new String[fileCount]; fileName[0] = "e_asthma_about.html"; fileName[1] = "e_asthma_inside1.html"; fileName[2] = "e_asthma_inside2.html"; fileName[3] = "e_asthma_inside3.html"; fileName[4] = "e_asthma_inside3a.html"; fileName[5] = "e_pop_step1.html"; fileName[6] = "e_asthma_inside3b.html"; fileName[7] = "e_asthma_inside3c.html"; fileName[8] = "e_pop_step3.html"; fileName[9] = "e_asthma_inside3d.html"; fileName[10] = "e_pop_step4.html"; fileName[11] = "e_asthma_inside3e.html"; fileName[12] = "e_asthma_inside3f.html"; for (int i=0; i < fileCount; i++) { FileInputStream fname = new FileInputStream(filePath + fileName[i]); InputStreamReader isr = new InputStreamReader(fname, "Big5"); BufferedReader brInputBuffer = new BufferedReader(isr); start = 0; intStartCheck = -1; intEndCheck = -1; startTable = -1; endTable = -1; statusTable = 0; out.println(""); out.println(""); out.println("
"); while ((thisLine = brInputBuffer.readLine()) != null) { // while loop begins here intStartCheck = thisLine.indexOf(""); startTable = thisLine.indexOf(""); if ((start == 1) && (statusTable == 2)) { if (intStartCheck != -1) { out.println(thisLine.substring(intStartCheck, thisLine.length())); } else if (intEndCheck != -1) { out.println(thisLine.substring(0, intEndCheck)); } else { out.println(thisLine); } } if (intStartCheck != -1) { start = 1; } if ((start == 1) && (intEndCheck != -1)) { start = 0; } if ((start == 1) && (startTable != -1) && (statusTable == 0)) { statusTable = 1; } if ((start == 1) && (endTable != -1) && (statusTable == 1)) { statusTable = 2; } } // end while out.println("
"); fname.close(); } %>