1

im using the jsp page and jstl following tag.

 <%@ 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">

when i run this it was shows following error...

  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}"/>';
                                                                 ^---^
Manihtraa
  • 968
  • 3
  • 12
  • 28

1 Answers1

2

Replace you core taglib

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

with

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

RBS
  • 207
  • 1
  • 11
  • Also try once using core_rt and fmt_rt i.e <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %> – Neha Shettar Apr 26 '17 at 04:38
  • 3
    Thanks for the idea, I had to do the opposite. I was using http://java.sun.com/jstl/core and changed to http://java.sun.com/jsp/jstl/core and that fixed the problem. – yts May 16 '18 at 16:00