user2848031
user2848031

Reputation: 225

How to convert tostring from JSTL?

I want to send the rows to jsp from selected checkbox in jstl .After getting the selected row value need to send it to jsp request.So i would to convert to toString.

if i use <c:out value="${product.tostring() getting EL error.Please advise.

<c:forEach items="${list}" var="product">
<td><input type="text" value='${product.featurename}' name="<c:out value="${product.featurename}" />" readonly="readonly"/></td>
<td><input type="text" value='${product.featureversion}' readonly="readonly"/></td>
<td><input type="text" value='${product.end_date}' readonly="readonly"/></td>
<td><input type="text" value='${product.new_end_date}' class="datepicker" name="<c:out value="${product.new_end_date}" />"/></td>
<td><input type="checkbox" value="<c:out value="${product}" />" name="newenddate" class="selectedId"/>
</c:forEach>

Upvotes: 3

Views: 6617

Answers (2)

Cesar Loachamin
Cesar Loachamin

Reputation: 2738

Only use

<input type="checkbox" value="${product}"/>

Upvotes: 2

Alex
Alex

Reputation: 11579

${product} will call method toString() implicitly.

Upvotes: 1

Related Questions