Lina
Lina

Reputation: 315

JSP Expression language syntax

I have a JSP page which is already developed. Below I am mentioning the line which I did not understand in that JSP page

<c:forEach items='${info.orders}' var='order' varStatus='status'>

In above line I did not understand from where info. comes and I checked in built in objects of expression language but this info object is not present

Upvotes: 1

Views: 236

Answers (2)

Sabir Khan
Sabir Khan

Reputation: 10142

info should be an attribute being set in back end Java code ( Servlet etc ). Check your back end Java code to figure out ( if its not being set in JSP with <c:set var= ).

Whatever Java class this attribute info represents must have a method, getOrders which might be returning a List i.e. info class must have a field orders.

Without access to your code base, its very hard to answer precisely esp. not knowing if there are any frameworks being used.

You should do an exact word search for info in your code base as this doesn't look like a built in object.

Upvotes: 5

su99-bsa
su99-bsa

Reputation: 457

long time ago i did JSP, but I believe you can set variables in JSP (besides the built-in like session, request).

Like

<c:set var="salary" scope="session" value="${2000*2}"/>
<c:out value="${salary}"/> 

Upvotes: 0

Related Questions