01.
<%@ page
import
=
"java.io.BufferedReader"
%>
02.
<%@ page
import
=
"java.io.File"
%>
03.
<%@ page
import
=
"java.io.FileReader"
%>
04.
<%@ page
import
=
"java.io.IOException"
%>
05.
<html>
06.
<head>
07.
<title>ThaiCreate.Com JSP Tutorial</title>
08.
</head>
09.
<body>
10.
11.
<%
12.
String path = application.getRealPath(
"/"
) +
"thaicreate.csv"
;
13.
File file =
new
File(path);
14.
15.
try
{
16.
BufferedReader br =
new
BufferedReader(
new
FileReader(file));
17.
String line;
18.
while
((line = br.readLine()) !=
null
) {
19.
String[] arr = line.split(
","
);
20.
out.print(arr[
0
]);
21.
out.print(
" - "
);
22.
out.print(arr[
1
]);
23.
out.print(
" - "
);
24.
out.print(arr[
2
]);
25.
out.print(
" - "
);
26.
out.print(arr[
3
]);
27.
out.print(
" - "
);
28.
out.print(arr[
4
]);
29.
out.print(
" - "
);
30.
out.print(arr[
5
]);
31.
out.println(
"<br>"
);
32.
}
33.
br.close();
34.
}
catch
(IOException e) {
35.
36.
e.printStackTrace();
37.
}
38.
%>
39.
40.
</body>
41.
</html>