I'm having trouble to display the CSV file into HTML. How can I make the next line in my csv file into another row in HTML table using loop? I'm still new to this jsp... Please give me some ideas to make it work.
<body>
<%
String fName = "F:\\web\\Sales.csv";
String thisLine;
int count=0;
FileInputStream fis = new FileInputStream(fName);
DataInputStream myInput = new DataInputStream(fis);
%>
<table>
<%
out.print("<table border = 1><thead><tr><th>Customer</th><th>Customer Type</th><th>Purchase</th></tr></thead><tbody>");
while ((thisLine = myInput.readLine()) != null){
String strar[] = thisLine.split(";");
for(int j=0;j<strar.length;j++){
out.print("<td>" +strar[j]+ "</td>");
}
out.println("\n");
}
%>
</table>
</body>