即时使用jsp页面和jstl跟随标记。
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib prefix="vlh" uri="/WEB-INF/tld/valuelist.tld" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Locale" %>
<%@ page isELIgnored ="false" %>
...... <c:forEach items="${list}" var="productInfo">
当我运行它时显示以下错误...
selectLoginProfile.jsp:144:17: Static attribute must be a String literal, its illegal to specify an expression.
<c:forEach items="${list}" var="productInfo">
^---^
selectLoginProfile.jsp:148:70: Static attribute must be a String literal, its illegal to specify an expression.
document.ProfileLoginForm.userName.value='<c:out value="${userInfo.userName}"/>';
^---^
答案 0 :(得分:2)
替换你的核心taglib
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
与
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>