我用JSP模糊查询数据库得到几条信息,但是他们都是不能点击的,如何能弄成象百度搜索出来的内容一样,带点击的,点击能查看详细信息,用什么实现呢?

解决方案 »

  1.   

    <table width="100%">
    <logic:iterate id="temp" name="pagerecordarray">
    <tr>
    <td>
    <html:link href="message.do?method=displayMessageContent" paramId="id"
    paramName="temp" paramProperty="messageid">
    <bean:write name="temp" property="messagetitle" />
    </html:link>
    </td>
    </tr>
    </logic:iterate>
    </table>
      

  2.   

    同意楼上,使用struts标签<logic:iterate>
      

  3.   

    我们还没学struts呢,用普通的servlet怎么实现呢?
      

  4.   

    取得的内容前面加上 href的连接 就行啊
      

  5.   

    <logic:iterate id="fund" name="allfund" scope="session">
                    <tr>
                        <td align="left">
                          <bean:write name="fund" property="fundId"/>
                        </td>
                        <td align="left">
                          <bean:write name="fund" property="fundName"/>
                        </td>
                        <td align="right">
                          <bean:write name="fund" property="price"/>
                        </td>
                        <td align="center">
                          <a href="navigationAction.do?buyfund=<bean:write name="fund" property="fundId"/>&price=<bean:write name="fund" property="price"/>">购买</a>
                        </td>
                    </tr>
                  </logic:iterate>看看这段代码吧,本人就是这样实现的
      

  6.   

    这种代码是要写到jsp页面的。
    类似于:
    <table>
    <c:forEach items="${requestScope.userarray}" var="temp">
    <tr>
    <td>
    用户名:
    </td>
    <td>
    <a href="servlet1?userid=${temp.userid}">${temp.username}</a>
    </td>
    </tr>
    </c:forEach>
    </table>
      

  7.   

    while(rs!=null&&rs.next()){str = rs.getString(5);
    //out.print(str);%><br>
    <a href = ../text.jsp><%=str%></a><%
    session.setAttribute("str",str);
    }我这样写完,传过去的总是最后一条结果,点,哪条都是最后一条结果,怎么改能点哪个就把点那个的参数传过去呢?