Help me please with converting Object to JSON String in JSTL. This is the part of the code of my JSP page:
<div class="form-group input-group">
<span class="input-group-addon">Equipment</span>
<select class="selectpicker" name="equipment" data-live-search="true">
<jsp:useBean id="Gson" class="com.google.gson.Gson"/>
<c:forEach var="equipment" items="${EquipmentBean.findAllEquipment()}">
<option value="${Gson.toJson(equipment)}"><c:out value="${equipment.name}"/></option>
</c:forEach>
</select>
</div>
I need it for further using JSON in JS. When I do this and look at serialized string in browser, I see the next: nickname=Hero&level=80&race=Human&weapon=1&equipment=%7B
.
equipment = %7B. What is the %7B? I get normal name in c:out, I can get any field, but don't convert it to JSON. Thank's in advance.