Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert tostring from JSTL?

Tags:

java

jsp

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>
like image 873
user2848031 Avatar asked Feb 02 '26 01:02

user2848031


2 Answers

Only use

<input type="checkbox" value="${product}"/>
like image 157
Cesar Loachamin Avatar answered Feb 03 '26 16:02

Cesar Loachamin


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

like image 23
Alex Avatar answered Feb 03 '26 15:02

Alex



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!