title: thymeleaf attribute check contains by other attribute value
body: <p>my spring controller send object "department" and my form get it
  and needs to check how many jobs from all departments is checked by the employee
  save works great but when user edit employee he needs to see the jobs that already checked.</p>
  
  <p>to make it work i need to make it like: th:checked="${jobs.contains(${job.id})}"
  but i guess i can't put attribute value inside other attribute value.</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div th:each="job : ${department.jobList}" class="col-md-4"&gt;
      &lt;fieldset class="form-group"&gt;
          &lt;label class="custom-control custom-checkbox"&gt;
              &lt;input name="jobs" th:checked="${jobs.contains(34L)}" th:value="${job.id}" type="checkbox" class="custom-control-input"/&gt;
              &lt;span th:text="${job.name}" class="custom-control-description"&gt;&lt;/span&gt;
              &lt;span class="custom-control-indicator"&gt;&lt;/span&gt;
          &lt;/label&gt;
      &lt;/fieldset&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>my controller:</p>
  
  <pre><code>// Edit employee page
  @RequestMapping("/panel/{workPlaceName}/employees/{id}")
  public String editEmployeesPage(Model model, HttpSession httpSession, HttpServletRequest request, @PathVariable Long id) {
      // Auto login check
      WorkPlace workPlace = new WorkPlace();
      Employee employee = new Employee();
      Object logInTemp = httpSession.getAttribute ("loggedInUser");
      if (logInTemp != null) {
          Object tempLogIn = httpSession.getAttribute ("loggedInUser");
          LogIn logIn = (LogIn) tempLogIn;
          workPlace = workPlaceService.findById(logIn.getUserName());
          model.addAttribute("workPlace",workPlace);
          employee = employeeService.findById(id);
          if(!model.containsAttribute("employee")) {
              model.addAttribute("employee", employee);
          }
      } else {
          return "redirect:/";
      }
  
      // END of Auto login check
      ArrayList&lt;Long&gt; jobs = new ArrayList&lt;&gt;();
      for (int i = 0; i &lt; employee.getJobList().size(); i++) {
          jobs.add(employee.getJobList().get(i).getId());
      }
      model.addAttribute("jobs", jobs);
      model.addAttribute("action", "/panel/" + workPlace.getName() + "/employees/" + employee.getId());
      return "workplace/editEmployee";
  }
  </code></pre>