I am studying Spring with Spring In Action book, i have the code from the book where it works fine:
@Slf4j
@Controller
@RequestMapping("/design")
public class DesignTacoController {
@GetMapping
public String showDesignForm(Model model) {
List<Ingredient> ingredients = Arrays.asList(
new Ingredient("FLTO", "Flour Tortilla", Type.WRAP),
new Ingredient("COTO", "Corn Tortilla", Type.WRAP),
new Ingredient("GRBF", "Ground Beef", Type.PROTEIN),
);
Type[] types = Ingredient.Type.values();
for (Type type : types) {
model.addAttribute(type.toString().toLowerCase(),
filterByType(ingredients, type));
}
model.addAttribute("design", new Taco());
return "design";
}
}
but when i typed it in my IDEA it says that method filterByType cannot be resolved, but there is no such problem in the book, and no any comment about this problem. I am new in the Spring, tried google a lot, but couldn't find any information about this problem and it source. Could you help me with this problem, a cannot move further because of it. screenshot from IDEA