將此文件保存為testimageoutjsp文件下一步要做的工作就是使用HTML標記
<%@ page contentType=
text/html;charset=gb
%>
<%@ page import=
java
sql
*
%>
<%@ page import=
java
util
*
%>
<%@ page import=
java
text
*
%>
<%@ page import=
java
io
*
%>
<jsp:useBean id=
conn
scope=
page
class=
dbconn
DBResult
/>
<%
String path = request
getContextPath();
String basePath = request
getScheme()+
://
+request
getServerName()+
:
+request
getServerPort()+path+
/
;
%>
<!DOCTYPE HTML PUBLIC
//W
C//DTD HTML
Transitional//EN
>
<html>
<head>
<base href=
<%=basePath%>
>
<title>My JSP
lookpic
jsp
starting page</title>
<meta http
equiv=
pragma
content=
no
cache
>
<meta http
equiv=
cache
control
content=
no
cache
>
<meta http
equiv=
expires
content=
>
<meta http
equiv=
keywords
content=
keyword
keyword
keyword
>
<meta http
equiv=
description
content=
This is my page
>
<!
<link rel=
stylesheet
type=
text/css
href=
styles
css
>
>
</head>
<body>
<%
String sql =
select * from p
;
ResultSet rs=conn
getResult(sql);
while(rs
next())
{
%>
<ccid_file values=
testimageout
% />
width=
height=
>
<br>
<%
}
rs
close();
%>
</body>
</html>
[] [] [] []
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20708.html