我这里有个list里面有多个字段,想在下拉里面显示出来其中一个,总是出现空白,这里的嵌套标签改怎么写?
action里面:list = getLineService().getLineService();
request.setAttribute("linelist", list);
页面:
<html:select name="shipRegisterForm" property="laneCode" styleClass="box_dzzt">
<c:forEach items="${linelist}" var="row">
<html:option value="${row.lineCode}">${row.lineCode}< html:option>
</c:forEach>
< html:select>
页面这样写也不行: <select name="laneCode" class="box_dzzt">
<logic:present name="linelist">
<logic:iterate id="al" name="linelist" >
<option value="${al.lineCode }">
<bean:write name="al" property="lineCode"/>
</option>
</logic:iterate>
</logic:present>
< select>
action里面:list = getLineService().getLineService();
request.setAttribute("linelist", list);
页面:
<html:select name="shipRegisterForm" property="laneCode" styleClass="box_dzzt">
<c:forEach items="${linelist}" var="row">
<html:option value="${row.lineCode}">${row.lineCode}< html:option>
</c:forEach>
< html:select>
页面这样写也不行: <select name="laneCode" class="box_dzzt">
<logic:present name="linelist">
<logic:iterate id="al" name="linelist" >
<option value="${al.lineCode }">
<bean:write name="al" property="lineCode"/>
</option>
</logic:iterate>
</logic:present>
< select>
解决方案 »
- 怎么获取EL表达式的值
- Spring+Hibernate中的临时表问题
- Resultset对象 得到不同类型的对象数组 怎么传递呢
- tomcat 5.0.28+hibernate2 问题,都一个月了,再解决不了明天就下岗,各位好心人,帮帮忙吧。
- Eclipse QQ群 14869853 (加入请注明Eclipse字样)
- 如何才能把jsp页面写成html的,因为jsp页面要频繁的读取数据库,会对服务器压力较大!
- 请教在jboss4.0.1下声明两个数据源的jndi出现冲突问题。。。谢谢。急
- 一般可以试用签约的,在什么情况话过不了试用期。
- 怎么设计电脑五子棋两机对弈程序?
- smart上传文件遇到的问题,请高人指教
- 如何将几张图片和一段音乐生成一段视频?
- HTTP Status 500:The server encountered an internal error () that prevented it from fulfilling this request.
楼主【zhanglei_1231】截止到2008-07-21 09:57:11的历史汇总数据(不包括此帖):
发帖的总数量:13 发帖的总分数:50 每贴平均分数:3
回帖的总数量:14 得分贴总数量:1 回帖的得分率:7%
结贴的总数量:13 结贴的总分数:50
无满意结贴数:10 无满意结贴分:210
未结的帖子数:0 未结的总分数:0
结贴的百分比:100.00% 结分的百分比:100.00%
无满意结贴率:76.92 % 无满意结分率:420.00%
敬礼!
public ArrayList getList(String sqlString, int type)
{
ArrayList pkv = new ArrayList(); try
{
conn = getConnection(type);
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(sqlString);
ResultSetMetaData rsmd = rs.getMetaData();
int num = rsmd.getColumnCount();
while (rs.next())
{
Hashtable table = new Hashtable();
for (int i = 1; i <= num; i++)
{
String key = rsmd.getColumnName(i);
String value = rs.getString(i);
if (value == null) value = "";
table.put(key, value);
}
pkv.add(table);
} }
catch (Exception e)
{
e.printStackTrace();
}
finally
{
try
{
if (stmt != null) stmt.close();
if (conn != null) conn.close();
}
catch (Exception e)
{
e.printStackTrace();
}
}
return pkv;
}
<select name="laneCode" class="box_dzzt">
<logic:iterate id="al" name="linelist" >
<option value="<bean:write name="al" property="lineCode"/>"/>
</logic:iterate>
< select>
这么写应该没问题啊你先在之前测试下list有没有值啊.