will ich eine ID zu einer URL in meiner Vorlage hinzufügen:Spring MVC Modell Attribut null
@Controller
public class DashboardController {
@RequestMapping("/dashboard")
public String index(Model model){
model.addAttribute("provider_id", "1");
return "dashboard";
}
}
In meinem dashboard.html ich die ID angezeigt werden soll.
<a th:href="@{'/cloudservice/' + ${provider_id}}">Show</a>
Aber die generierte URL ist /cloudservice/null
. Warum wird nicht die 1 angezeigt, die ich in das Modell einfüge?