日期:2014-05-18  浏览次数:20827 次

jstl标签如何遍历request中的对象.
请给出代码示例.
我request中放入
request.setAttribute( "quesList ",   quesList);
quesList是dto.

想用for   each标签遍历出来.

          <c:forEach   var= "ques "   items= "quesList ">
<tr>
        <td>
                    <c:out   value= "${ques.id} "   />
        </td>
        <td>
        <input   type= "text "   id= "question "   value= "${question.content} ">
        </td>
</tr>
</c:forEach>
出现
org.apache.jasper.JasperException:   /WEB-INF/jsp/question/listques.jsp(56,7)   According   to   TLD   or   attribute   directive   in   tag   file,   attribute   value   does   not   accept   any   expressions
错误,急死我了.
请给出代码示例.



------解决方案--------------------
<input type= "text " id= "question " value= "${question.content} ">
里的value应该是value= "${ques.content} "吧?
------解决方案--------------------
http://hi.baidu.com/uniquejava/blog/item/2df796cb875b25fc52664fcb.html
------解决方案--------------------
帮顶~~
------解决方案--------------------
标签的标签库没有引入
还有就是根本没这个一个标签
------解决方案--------------------
<c:forEach var= "ques " items= "${quesList} ">
<tr>
<td>
<c:out value= "${ques.id} " />
</td>
<td>
<input type= "text " id= "question " value= "${question.content} ">
</td>
</tr>
</c:forEach>

------解决方案--------------------
JSP页面上加:
<%@ taglib uri=http://java.sun.com/jstl/core_rt prefix= "c "%>
或者自己配置c_rt标签