Answer the question
In order to leave comments, you need to log in
What is wrong with jsp?
I have code:
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
....
<logic:iterate id="user" name="Records" property="users">
<tr>
<td><bean:write name="user" property="from"/></td>
<td><bean:write name="user" property="where"/></td>
<%--<td><bean:write name="user" property="day" format=""/></td>--%>
<td>
1) <c:set var = "day" value = "${user.getDay()}" scope="session"></c:set>
<c:choose>
<c:when test="day != 0">
<bean:write name="user" property="day" format=""/>
</c:when>
<c:otherwise>
${pageScope.day}
</c:otherwise>
</c:choose>
</td>
<td><bean:write name="user" property="month" format=""/></td>
<td><a href="<bean:write name="user" property="vkId"/>"> VK</a></td>
<td><bean:write name="user" property="comment"/></td>
</tr>
</logic:iterate>
Answer the question
In order to leave comments, you need to log in
1. Preferably use a different taglib declaration
2. Try like this:
The Expression Language in JSP itself understands what to call, according to the JavaBeans specification.
Those. in the user class, this can be both a public field named day and a getter method like getDay().
Read more: read the JSP Expression Language specification.
The Java EE 6 Tutorial : Overview of the EL
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question