<%while(rs.next()){%>
<%String path;%>
<tr>
</tr>
<tr>
<td><a href="#"><%="★ "+ rs.getString("STitle")%></a>
</td>
</tr>
<%}%>rs 是 ResultSet的对象
我这个是一个动态连接:<%="★ "+ rs.getString("STitle")%>这是连接的文字;
<a href="#">是需要连接的目的文件(暂定打开txt格式)地址;连接后能将该文件的内容能在跳转后的html页面上显示.下面的格式我试了,错误:
<a href=" 'file:///'+<%=path=rs.getString("SCreatPath")%>"><%="★ "+ rs.getString("STitle")%></a>
谁知道,谢谢!
<%String path;%>
<tr>
</tr>
<tr>
<td><a href="#"><%="★ "+ rs.getString("STitle")%></a>
</td>
</tr>
<%}%>rs 是 ResultSet的对象
我这个是一个动态连接:<%="★ "+ rs.getString("STitle")%>这是连接的文字;
<a href="#">是需要连接的目的文件(暂定打开txt格式)地址;连接后能将该文件的内容能在跳转后的html页面上显示.下面的格式我试了,错误:
<a href=" 'file:///'+<%=path=rs.getString("SCreatPath")%>"><%="★ "+ rs.getString("STitle")%></a>
谁知道,谢谢!
要用http://ip/appname/<%=path=rs.getString("SCreatPath")%>
http://localhost/files/file.txt 是你要显示的txt文件的绝对路径,即你输入这个路径直接可以打开这个txt文档。如果用相对链接的话,<a href="files/file.txt">或者 ,<a href="../files/file.txt">
files/file.txt 这个路径和你的当前页面的位置有关