为什么数据不能显示?
xjxy 2006-07-19 08:38:15 在UserList.java中有如下代码:
public static String getUserListHTML() {
……………………
while (rs.next())
{
String UID=rs.getString("user_id");
String UName=rs.getString("user_name");
//System.out.println("uid: "+UID+" Uname :"+UName);
sBuf.append("<option value='" + UID + "'>" +UName + "</option>\n");
}
System.out.println(sBuf.toString());
return sBuf.toString();
………………………………
}
另一页面中:
<%@page contentType="text/html; charset=GBK" %>
<%@page import="bookstore.UserList" %>
<html>
<head>
<title>login</title>
</head>
<body bgcolor="#ffffff">
<form name="form1" action="switch.jsp" method="POST">
用户名:<select name="userId">
<option value="" selected>--loggin user--</option>
<%=UserList.getUserListHTML() %> //-->该句不会在页面上显示
</select>
………………
请教如何解决?谢谢