Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Java Spring Basics Using the MVC Architecture Fix a Model

It doesn't look like the correct change was made. Think about the typical way you would access a private field from ano

h

com/teamtreehouse/todo/model/Task.java
package com.teamtreehouse.todo.model;

import java.time.LocalDateTime;

public class Task {
  private String description;
  private LocalDateTime dueDateTime;
  private boolean complete;

  public Task(String description, LocalDateTime dueDateTime) {
    this.description = description;
    this.dueDateTime = dueDateTime;
    this.complete = false;
  }

  public String getDescription() {
    return description;
  }
  public boolean getGetComplete(){
    return this.complete;
  }

  public void setDescription(String description) {
    this.description = description;  
  }

  public LocalDateTime getDueDateTime() {
    return dueDateTime;  
  }

  public void setDueDateTime(LocalDateTime dueDateTime) {
    this.dueDateTime = dueDateTime;  
  }

  public void setComplete(boolean complete) {
    this.complete = complete;  
  }
}

1 Answer

Dino Šporer
Dino Šporer
5,430 Points

You are missing getter!

public boolean getComplete(){ return complete; }

Because , Thymeleaf doesn't access variable directly, he uses a getter :)