为什么el表达式获取不到值

PeterHeHeHe 2014-06-13 11:14:34
public class ThreadPoolVO {

private String threadName;

private String appEndpointType;

public String getThreadName() {
return threadName;
}

public void setThreadName(String threadName) {
this.threadName = threadName;
}

public String getAppEndpointType() {
return appEndpointType;
}

public void setAppEndpointType(String appEndpointType) {
this.appEndpointType = appEndpointType;
}
}

//获取线程池名称
List<ThreadPoolVO> threadPollList = threadPoolConfiginfoService.getThreadpoolNameByType(ENDPOINTTYPE);
request.setAttribute("threadPollList", threadPollList);


<td>线程名称:<select id="threadName">
<c:forEach var="thread" items="${threadPollList }" varStatus="status">
<option value="" selected="selected">${thread.threadName }</option>
</c:forEach>
</select></td>

为什么页面上获取不到,求解答,${threadPollList }这个是可以取到的
...全文
857 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
鲨鱼也是鱼 2016-10-08
  • 打赏
  • 举报
回复
private String threadName; 改为public String threadName;
CinKateRen 2016-10-06
  • 打赏
  • 举报
回复
我的也是这样,为啥?楼主解决了吗
qq_16528137 2014-06-14
  • 打赏
  • 举报
回复
10楼的办法是正确的。去掉value属性
什么都不能 2014-06-14
  • 打赏
  • 举报
回复
容器是不是tomcat,如果不是有可能容器不支持el,用jstl标签试试看。 <td>线程名称:<select id="threadName"> <c:forEach var="thread" items="${threadPollList }" varStatus="status"> <option value="" selected="selected"><c:out value="${thread.threadName}" /></option> </c:forEach> </select></td>
PeterHeHeHe 2014-06-13
  • 打赏
  • 举报
回复
没有啊,不行啊
wyx100 2014-06-13
  • 打赏
  • 举报
回复
引用 5 楼 fangmingshijie 的回复:
去掉selected="selected"
PeterHeHeHe 2014-06-13
  • 打赏
  • 举报
回复
还是没有,是不是我request.addAttribute时候是空的,还是set/get方法,也有啊,还有哪里出了问题
  • 打赏
  • 举报
回复
去掉selected="selected"
PeterHeHeHe 2014-06-13
  • 打赏
  • 举报
回复
有对象的,monitormanage.pojo.ThreadPoolVO@1196f3b
  • 打赏
  • 举报
回复
直接${thread}有值不。
小成长 2014-06-13
  • 打赏
  • 举报
回复
<option value="" selected="selected">${thread.threadName }</option> value="" 这个去掉。
PeterHeHeHe 2014-06-13
  • 打赏
  • 举报
回复
有的,里面的ThreadPoolVO 对象都可以取得,就是无法点出属性值,晕了
S117 2014-06-13
  • 打赏
  • 举报
回复
threadPollList里有值吗
yn799890274 2014-06-13
  • 打赏
  • 举报
回复
后台debug检查下threadPollList里的ThreadPoolVO对象属性有没有值

81,091

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧