0
votes

When I try to run my web page, I am getting this error:

org.apache.jasper.JasperException: javax.el.PropertyNotFoundException: The class 'java.lang.String' does not have the property 'id'.

And this is my code:

 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%-- 
    Document   : index
    Created on : Aug 11, 2017, 9:57:00 PM
    Author     : Samson Christopher
--%>

<sql:query var="categories" dataSource="jdbc/estore">
    SELECT * FROM category

</sql:query>
            <div id="indexLeftColumn">
                <div id="welcomeText">
                    <p>[welcome text]</p>
                    <!--test to access context parameter-->
                    categoryImagePath: ${initParam.categoryImagePath}
                    productImagePath: ${initParam.productImagePath}
                </div>
            </div>

            <div id="indexRightColumn">
                <c:forEach var="category" items="$(categories.rows)">
                    <div class="categoryBox">
                        <a href="category?${category.id}">
                            <span class="categoryLabelText">${category.name}</span>
                            <img src="${initParam.categoryImagePath}${category.name}.jpg" alt="${category.name}">
                        </a>
                    </div>
                </c:forEach>
            </div>``

And I need to submit my project within 5 days, please somebody help!

1
Hey! Did you check my answer? - Tahir Hussain Mir

1 Answers

0
votes

You have done a mistake in your code. You have used parentheses(round) instead of curly braces.
Mistake

items="$(categories.rows)"

You should have written

items="${categories.rows}"

inside the foreach tag.