我想在out,println语句(servlet)中写表行和表数据之间的超链接,但我不能

时间:2017-03-13 23:01:23

标签: servlets

out.print("" ++"" + rs3.getInt(1)+"" + rs3.getString(2)+& #34;&#34 + rs3.getString(3)+"&#34 + rs3.getString(4)+"&#34 + rs3.getString(5)+&#34 ;" + rs3.getString(6)+"" + rs3.getString(7)+"" + rs3.getString(8)+"& #34);

1 个答案:

答案 0 :(得分:-1)

我假设您正在尝试在servlet中实现类似的功能......

<html>
<body>
<table border='1'>
    <tr>
        <td> <a href="link/to/another/page" >LinkToAnotherPage</a> </td>
        <td> <a href="link/to/another/page" >LinkToAnotherPage</a> </td>
        <td> <a href="link/to/another/page" >LinkToAnotherPage</a> </td>
    </tr>
</table>
</body>
</html>

然后,在servlet中,它的等价将是......

String myPath="link/to/another/page";
out.print("<table border='1'> <br>" );
out.print("<tr> <br>");
out.print("<td> <a href='"+myPath+"'>LinkToAnotherPage </a> </td>");
out.print("<td> <a href='"+myPath+"'>LinkToAnotherPage </a> </td>");
out.print("</tr> </table> </body> </html>");

href=之后注意&#39; &#34;