Witam, walczę z aplikacja webowa i mam problem z makrami springowymi, a mianowicie nie mogę w żaden sposób przekazać atrybutu z ModelMap do zadnego marka.
tak wyglada moj kontroler:
@RequestMapping(value = "/bookDetails/{module}", method = RequestMethod.GET)
public String index(@ModelAttribute("model") ModelMap model, @PathVariable("module") String currentModule) {
setUpAuthors();
setUpBookKinds();
String message = "WTF?!";
List<BookKind> bookKindList = bookKindServiceImpl.findAll();
bookKindList.forEach((bookKind) -> bookKindMap.put(bookKind.getId().toString(), bookKind));
authorList = authorServiceImpl.findAll();
model.addAttribute("bookKindMap", bookKindMap);
model.addAttribute("authorList", authorList);
model.addAttribute("message", message);
return "book";
}
a tak widok:
<#import "spring.ftl" as spring/>
<#include "/header.ftl" />
<div id="bookForm">
<form method="POST" action="/Library/save.html" commandName="bookKindMap">
<table>
<tr>
<td>Title:</td>
<td><input type="text" path="title" name="title"/></td>
</tr>
<tr>
<td>ISBN:</td>
<td><input type="text" name="isbn"/></td>
</tr>
<tr>
<td>Page quantity:</td>
<td><input type="text" name="pageQuantity"/></td>
</tr>
<tr>
<td>Author:</td>
<td>
<select>
<#list model["authorList"] as author>
<option>${author.firstName} ${author.lastName} </option>
</#list>
</select>
</td>
</tr>
<tr>
<td>kind:</td>
<td>
<@spring.bind "model" />
<@spring.message model.message/>
</td>
</tr>
<tr>
<td>Release date:</td>
<td><input type="text" name="releaseDate"/></td>
</tr>
</table>
<input type="submit" value="Save"/>
</form>
<a href="/Library/index.html"><button class="button">Cancel</button></a>
</div>
<#include "/footer.ftl"/>
próbowałem już wszystkiego, lecz ciągle dostaję błedy albo o niepoprawnej składni albo o nullach
Czy ktos wie co tu jest nie tak?