Twitter bootstrap 单击链接不适用于thymeleaf
我使用spring boot、thymeleaf和bootstrap 当我进入我的车辆页面时,我想显示所有车辆Twitter bootstrap 单击链接不适用于thymeleaf,twitter-bootstrap,spring-mvc,spring-boot,thymeleaf,Twitter Bootstrap,Spring Mvc,Spring Boot,Thymeleaf,我使用spring boot、thymeleaf和bootstrap 当我进入我的车辆页面时,我想显示所有车辆 @GetMapping("/vehicle") public String getVehiclesList(final Model model) { List<vehicle> vehicles = vehicleService.getAll(); model.addAttribute("vehicles", vehicles);
@GetMapping("/vehicle")
public String getVehiclesList(final Model model) {
List<vehicle> vehicles = vehicleService.getAll();
model.addAttribute("vehicles", vehicles);
return "vehicle";
}
我有一个片段名称:菜单
<ul class="nav nav-pills nav-stacked">
<li role="presentation" data-toggle="tab" class="active">
<a href="#">Sport</a>
</li>
<li role="presentation" data-toggle="tab">
<a href="/vehicle" th:href="@{/vehicle}">Vehicule</a>
</li>
</ul>
当我点击车辆时,什么也没发生
但如果我把vehicle放在url中,那就行了
似乎引导程序事件不起作用
编辑
单击链接时未显示的车辆文件的代码
<!DOCTYPE html>
<html th:lang="${#locale.language}" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head th:replace="fragments/head :: head-css"/>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-sm-2 column menu_side">
<div th:replace="fragments/menu :: left-menu"/>
</div>
<div id="main" class="col-sm-10 column">
<div role="tabpanel">
<form th:action="@{/vehicle-layout}" method="post">
<div class="form-group">
<label for="definition">Pick a base vehicle</label>
<select class="form-control" id="vehicle">
<option th:value="NULL" selected="selected" > -- select the vehicle --</option>
<option th:each="vehicle : ${vehicles}" th:value="${vehicle.id}" th:text="${vehicle.name}"></option>
</select>
</div>
</form>
</div>
</div>
</div>
</div>
<div th:replace="fragments/footer :: footer"/>
</body>
</html>
编辑2(如果已删除)
数据切换=选项卡
在菜单中,工作。。。我真的不明白为什么。我使用了这里可用的技术 那很好
不知道是否可以用标准引导程序来实现…我使用了这里提供的技术 那很好
不知道是否可以使用标准引导…车辆名称同样,按照惯例,您的类应该以大写字母开头。从链接中删除href属性,您只需要th:href属性。我认为这个问题与引导无关。@bphilipnyc不相关。。。查看车辆只是不显示。。。。如果我直接在url栏中键入:,我会看到vehicule。。。但当我点击网站上的链接时就不是了menu@tamás-g,什么都不要改变。。。此外,100%可以编写@bphilipnyc之类的内容,单击时不显示视图。。。显示的html用于菜单。。。当我单击菜单中的车辆条目时。。。。应该显示车辆视图。。。如果我把localhost:8080/vehicle放在url栏中,我会看到vehicles..vehicles名称。根据惯例,您的类应该以大写字母开头。从链接中删除href属性,您只需要th:href属性。我认为这个问题与引导无关。@bphilipnyc不相关。。。查看车辆只是不显示。。。。如果我直接在url栏中键入:,我会看到vehicule。。。但当我点击网站上的链接时就不是了menu@tamás-g,什么都不要改变。。。此外,100%可以编写@bphilipnyc之类的内容,单击时不显示视图。。。显示的html用于菜单。。。当我单击菜单中的车辆条目时。。。。应该显示车辆视图。。。如果我把localhost:8080/vehicle放在url栏中,我会看到车辆。。