一、问题
1、前端jsp片段
<table width="100%" border="1">
<tr>
<td>商品ID</td>
<td>商品介绍</td>
<td>商品名称</td>
<td>操作</td>
</tr>
<c:forEach items="${itemlistKey}" var="items">
<tr>
<td>${items.id}</td>
<td>${items.js}</td>
<td>${items.mc}</td>
<td><a href="${pageContext.request.contextPath}/item/editItem.action?id=${items.id}">修改</a> </td>
</tr>
</c:forEach>
</table>
显示页面(火狐浏览器):
也就是foreach 根本没解析后台传过来的变量;
二;解决办法
jsp中加入
<%@ page isELIgnored="false"%>
三、讨论isELIgnored 作用
<%@ page isELIgnored=”true|false”%>
如果设定为真,那么JSP中的表达式被当成字符串处理。比如下面这个表达式<p>{2000 % 20}</p>在isELIgnored="true"时输出为
{2000 % 20}</p>在isELIgnored="true"时输出为
{2000 % 20},而isELIgnored=”false”时输出为100。
注意:有的web浏览器默认为true(firefox),有的默认为false