JSTL EL does not work in all cases
----------------------------------

                 Key: SLING-2455
                 URL: https://issues.apache.org/jira/browse/SLING-2455
             Project: Sling
          Issue Type: Bug
          Components: Scripting
         Environment: Mac OSX
            Reporter: Sandro Boehme
            Priority: Minor


At the latest trunk (rev.1309704) a jstl expression within a <c:forEach> tag 
throws the jsp compile error 
"org.apache.sling.scripting.jsp.jasper.el.JspValueExpression cannot be resolved 
to a type"

Example jsp:
<%@ page session="false"%>
<%@ page isELIgnored="false"%>
<%@ page import="javax.jcr.*,org.apache.sling.api.resource.Resource"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
<%@ taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0"%>
<sling:defineObjects />

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>

<%--
The following two tags dont work.
--%>
        <c:forEach var="property" items="${currentNode.properties}">
                ${property.name}
        </c:forEach>
        <c:set var="nodePath" scope="request" value="${currentNode.path}"/>

<%--
The following two tags do work.
--%>
        <c:forEach var="property" items="<%=currentNode.getProperties()%>">
                ${property.name}<br/>
        </c:forEach>
        
        <c:if test="${currentNode.path=='/content/mynode'}">
                <br/>in if statement
        </c:if>
</body>
</html>

I know you know how to do that but just to make it easier for you, here are the 
commands:
curl -u admin:admin -F"sling:resourceType=el" -F"prop1=val1" -F"prop2=val2" 
http://localhost:8080/content/mynode
curl -X MKCOL -u admin:admin http://localhost:8080/apps/el
curl -u admin:admin -T el.jsp http://localhost:8080/apps/el/html.jsp
URL to test: http://localhost:8080/content/mynode.html

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to