0
<input type="text" name="${task.getTaskId()}today" placeholder="${tm.get(LocalDate.now()).contains(task.getTaskId()) ? 'saved' : 'dosa'}" size="2">

This is my code situated inside a <c:forEach items="${tasks}" var="task" >. tm is a HashMap<LocalDate,List<String>> I tried the same code in a java file it works. But in jsp it doesn't. I always get dosa which implies the condition is false. Why is this ?

Jithin Sebastian
  • 511
  • 1
  • 6
  • 19

1 Answers1

0

It might not fully answer your question, but as far as I know to access a property or field or instance var in EL you don't use Java getter methods but the "." notation or the square brackets.

So for instance while in Java you would go

task.getTaskId()

In EL that would be

task.taskId

or

task['taskId']

Then I would probably check if there's a JSTL function that can check if a value is contained in a map

Angelo Oparah
  • 673
  • 1
  • 7
  • 18