Following is a sample class:-
public class Response {
private String hash;
private Integer count;
private Optional<String> name = Optional.empty();
// getters and setters
}
Now in the JSP file, I can access the fields, something like:-
<c:forEach var="rr" items="${data}">
${rr.hash}
...
</c:forEach>
My question is, how will I come to know in the JSP file if the value for that field exists? There is a name
field which is optional. If for an instance, I have not set it's value, then how can I know this is the JSP file?