今天遇到一此jsp代码,不知道是如何连接sql数据库的?
指点一下,
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%><c:forEach items="${pageScope.searchResult}" var="current">
<%-- nitrox:varType="cn.banny.vod.entity.ProgramInfo" --%>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD width=146 height=186>
<TABLE height=166 cellSpacing=0 cellPadding=2 width=126
align=center background="images/disc_border1.gif" border=0>
<TBODY>
<TR>
<TD class=disctbg1 align=middle><FONT color=#000000><A
href="index.jsp?film=true&id=${current.programId }"><IMG
class=border123 height=157
src="showPhoto?id=${current.programId }" width=120
border=0></A></FONT></TD>
</TR>
</TBODY>
</TABLE>
</TD>
<TD width=1 bgColor=#d5d5d5></TD>
<TD vAlign=top height=100>
<TABLE height="100%" cellSpacing=0 cellPadding=1
width="100%" border=0>
<TBODY>
<TR>
<TD vAlign=center height=33 style="text-align: left;"><STRONG><IMG
height=9 src='images/ico4.gif' width=9 border=0><A
href='index.jsp?film=true&id=${current.programId }'><FONT
color=#cc3300>${current.progTitle }</FONT></A></STRONG></TD>
</TR>
<TR>
<TD background='images/line_x(1).gif' height=1></TD>
</TR>
<TR vAlign=center>
<TD height=23 style="text-align: left;"><STRONG><SPAN
class=moviename2><FONT color=#339900>领衔主演:</FONT></SPAN>
</STRONG>${current.mainActor }</TD>
</TR>
<TR>
<TD width='32%' background='images/line_x(1).gif'
height=1></TD>
</TR>
<TR vAlign=center>
<TD height=24 style="text-align: left;"><STRONG><SPAN
class=moviename2><FONT color=#0099ff>影片类型:</FONT></SPAN>
</STRONG><FONT color=#666666>${vod:getVideoFormat(current.progType)
}</FONT></TD>
</TR>
<TR>
<TD background='images/line_x(1).gif' height=1></TD>
</TR>
<TR vAlign=center>
<TD height=25 style="text-align: left;"><STRONG><SPAN
class=moviename2><FONT color=#ff9900>发布时间:</FONT></SPAN>
</STRONG><SPAN class=eng_S>${vod:formatDate(vod:getDate(current.createDate),
"yyyy 年 MM 月 dd 日") }</SPAN></TD>
</TR>
<TR>
<TD background='images/line_x(1).gif' height=1></TD>
</TR>
<TR vAlign=center>
<c:set var="recommend"
value="${vod:getRecommendById(current.programId)}" />
<TD style="text-align: left;"><STRONG><FONT
color=#9966ff>推荐级别:</FONT><IMG
src='images/${not empty recommend ? recommend.rlevel : "3"}STAR.gif'
border=0></STRONG></TD>
</TR>
<TR>
<TD background='images/line_x(1).gif' height=1></TD>
</TR>
<TR vAlign=center>
<TD style="text-align: left;"><STRONG><SPAN
class=moviename2><FONT color=#ff00ff>观看次数:</FONT></SPAN></STRONG>${current.frequency
}</TD>
</TR>
<TR>
<TD background='images/line_x(1).gif' height=1></TD>
</TR>
<TR vAlign=center>
<TD style="text-align: left;"><A
href='index.jsp?film=true&id=${current.programId }'><IMG
height=20 src='images/ico_view.gif' width=78
align=right border=0></A></TD>
</TR>
</TBODY>
</TABLE>
</TD>
<TD width=1 bgColor=#d0d0d0></TD>
</TR>
</TBODY>
</TABLE>
</c:forEach>
指点一下,
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%><c:forEach items="${pageScope.searchResult}" var="current">
<%-- nitrox:varType="cn.banny.vod.entity.ProgramInfo" --%>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD width=146 height=186>
<TABLE height=166 cellSpacing=0 cellPadding=2 width=126
align=center background="images/disc_border1.gif" border=0>
<TBODY>
<TR>
<TD class=disctbg1 align=middle><FONT color=#000000><A
href="index.jsp?film=true&id=${current.programId }"><IMG
class=border123 height=157
src="showPhoto?id=${current.programId }" width=120
border=0></A></FONT></TD>
</TR>
</TBODY>
</TABLE>
</TD>
<TD width=1 bgColor=#d5d5d5></TD>
<TD vAlign=top height=100>
<TABLE height="100%" cellSpacing=0 cellPadding=1
width="100%" border=0>
<TBODY>
<TR>
<TD vAlign=center height=33 style="text-align: left;"><STRONG><IMG
height=9 src='images/ico4.gif' width=9 border=0><A
href='index.jsp?film=true&id=${current.programId }'><FONT
color=#cc3300>${current.progTitle }</FONT></A></STRONG></TD>
</TR>
<TR>
<TD background='images/line_x(1).gif' height=1></TD>
</TR>
<TR vAlign=center>
<TD height=23 style="text-align: left;"><STRONG><SPAN
class=moviename2><FONT color=#339900>领衔主演:</FONT></SPAN>
</STRONG>${current.mainActor }</TD>
</TR>
<TR>
<TD width='32%' background='images/line_x(1).gif'
height=1></TD>
</TR>
<TR vAlign=center>
<TD height=24 style="text-align: left;"><STRONG><SPAN
class=moviename2><FONT color=#0099ff>影片类型:</FONT></SPAN>
</STRONG><FONT color=#666666>${vod:getVideoFormat(current.progType)
}</FONT></TD>
</TR>
<TR>
<TD background='images/line_x(1).gif' height=1></TD>
</TR>
<TR vAlign=center>
<TD height=25 style="text-align: left;"><STRONG><SPAN
class=moviename2><FONT color=#ff9900>发布时间:</FONT></SPAN>
</STRONG><SPAN class=eng_S>${vod:formatDate(vod:getDate(current.createDate),
"yyyy 年 MM 月 dd 日") }</SPAN></TD>
</TR>
<TR>
<TD background='images/line_x(1).gif' height=1></TD>
</TR>
<TR vAlign=center>
<c:set var="recommend"
value="${vod:getRecommendById(current.programId)}" />
<TD style="text-align: left;"><STRONG><FONT
color=#9966ff>推荐级别:</FONT><IMG
src='images/${not empty recommend ? recommend.rlevel : "3"}STAR.gif'
border=0></STRONG></TD>
</TR>
<TR>
<TD background='images/line_x(1).gif' height=1></TD>
</TR>
<TR vAlign=center>
<TD style="text-align: left;"><STRONG><SPAN
class=moviename2><FONT color=#ff00ff>观看次数:</FONT></SPAN></STRONG>${current.frequency
}</TD>
</TR>
<TR>
<TD background='images/line_x(1).gif' height=1></TD>
</TR>
<TR vAlign=center>
<TD style="text-align: left;"><A
href='index.jsp?film=true&id=${current.programId }'><IMG
height=20 src='images/ico_view.gif' width=78
align=right border=0></A></TD>
</TR>
</TBODY>
</TABLE>
</TD>
<TD width=1 bgColor=#d0d0d0></TD>
</TR>
</TBODY>
</TABLE>
</c:forEach>
解决方案 »
- 我自己做了网站,前几天还能用电脑上的浏览器打开,现在不知道为什么就只能用手机浏览器访问了.
- 向sqlserver2005数据库中插入数据,但是显示在数据库中的汉字为乱码?急需大家帮忙!!!代码如下
- Java Web 多国语言,,多国语言网站
- 急!单元格内插入图片高度被撑大了3个像素(在ie中,在火狐中正常)。
- window.open() 中的路径不是 request的?
- jsp中使用超级连接传递参数
- 求一正则表达式
- jbuilder调试JSP到底要怎么操作呢?
- 小问题--求救:翻页的问题--共x页?第y页?
- SpringBoot请求拦截再转发问题
- 怎样用EXT、html、css、java来建个论坛?
- 求java程序员转做银行类开发所需资料
这个只是显示结果集的
pageScope.searchResult是个结果集,具体操作数据库取得这些数据的页面,或者类,在这个页面之前
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
这三行是什么意思啊,最近刚接触JSP,正在看代码呢,不知道怎么回事?谢谢
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
载入指定的标签库供页面使用
jstl挺不错的,有空看看
引入JSTL标签, prefix="c"给标签起别名,
<c:forEach items="${pageScope.searchResult}" var="current">循环读取searchResult里面的数据