How can I get the value from the method of an Object (e.g., length of a
String by calling myString.length()) and set the value of the length to a variable?
In the code below, my objective is to set myVar with the length() value obtained from myString of myForm object.
Code is somewhat like:
<c:choose>
<c:when test="${someCondition}">
<c:set var="${myVar}" value="${myForm.myString}"></c:set>
</c:when>
<!-- More <c:when> conditions -->
</c:choose>
myForm is an object which has myString as attribute with corresponding public getter and setter methods.
I get syntax error if "${myForm.myString}" is replaced with value="${myForm.myString.length}
I want to get the length of myString and set that value to myVar for future use in
JSP.
Is there a work-around if I cannot use fn? I cannot use fn:length() as I am advised because of the level of JSp support
Any help will be appreciated.