我的源程序:(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源程序
<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源程序
解决方案 »
- JAVA poi导出excel 换了服务器 怎么不好用了
- struts2 如何在tomcat启动时的信息屏蔽
- 100分请高人帮我看看这是什么错误,谢谢先!!!
- 单选按钮自动提交问题 AND 日期型转换问题!@~ 急急急急急急急急急
- 问一超级菜问题,java sdk3.1哪里有下载?
- 想利用JspsmartUpload组件把图片上传到FTP上该怎么写?
- 大家谁知道开发一个www.uume.com需要多少时间。
- 求很好的分页的思路,oracle,50000条数据,有个主键id是根据日期生成的,最后order by id desc
- 有两个单选按钮,怎样判断选中了哪一个?
- 哪里有比较好的中文JSP入门教程啊?
- 刷新问题~:(
- oracle 8i 数据库连接问题
<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>
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的后面?
<%=rs.getString("title")%></a>
虽然只差一个等号,意思可不一样。
输出的东西最好是String类型的。