我的源程序:(list.jsp)
<wml>   <card id="card1" title="时尚资讯搜索"> 
<center>
<p> 
<b><%out.print("明星地带");%></b><br>

<!-- Write your card implementation here. --> 

<%  int num;
num = request.getParameter("id");
String sql="select * from tbl_fadsmalltitle where id = " + num;
         ResultSet rs=stmt.executeQuery(sql);
                //rs.absolute(1);
    //out.println(rs.getString(1));
while(rs.next()) {
         if(rs.getInt("rw_id")==1){%>
<%=rs.getString("content")%>
<br>
<%}
}%>
<%rs.close();
stmt.close();
conn.close();
%>
<a href = "fadsearch.jsp">首页</a> 
</p>

</card>

</wml>st1.jsp源程序

解决方案 »

  1.   

    <wml>  <card id="card1" title="时尚资讯搜索"> 
    <center>
    <p> 

    <b><%out.print("明星地带");%></b><br>

    <!-- Write your card implementation here. --> 

    <%
    String sql="select * from tbl_fadsmalltitle";
    ResultSet rs=stmt.executeQuery(sql);
        //rs.absolute(1);
       //out.println(rs.getString(1));
    while(rs.next()) {
    String str;
    str = "list.jsp?id=" +rs.getInt("id");
    if(rs.getInt("rw_id")==1){
    %>
    <a href="<%=str%>">
    <%=rs.getString("title")%></a>
    <br>
    <%}
    }%>
    <%rs.close();
    stmt.close();
    conn.close();
    %>
    <a href = "fadsearch.jsp">首页</a> 
    </p>

    </card>

    </wml>
      

  2.   

    <a href=list.jsp?id=<%=rs.getInt("id")%>>
      

  3.   

    疑点一、int num;
    num = request.getParameter("id");
    String sql="select * from tbl_fadsmalltitle where id = " + num;request.getParameter("id")返回的是String,而你的num定义的是int,还有下面的sql也是String,再加上num?疑点二、String str;
    str = "list.jsp?id=" +rs.getInt("id");rs.getInt("id")返回的是int,而你把它加在类型为String的str的后面?
      

  4.   

    <a href=list.jsp?id=<%=rs.getInt("id")%>>
      

  5.   

    <a href=list.jsp?id=<%=rs.getInt("id")%>>
    <%=rs.getString("title")%></a>
    虽然只差一个等号,意思可不一样。
    输出的东西最好是String类型的。