2
我有一个Spring/Thymeleaf应用程序,春/ Thymeleaf:属性或字段不能在空发现,但仍呈现
org.springframework.expression.spel.SpelEvaluationException: EL1007E:(pos 0): Property or field 'projectName' cannot be found on null
然而,页面看起来正常。所有变量都使用数据进行渲染。我只关心每个请求都会抛出异常。
这里是控制器:
@Controller
@RequestMapping("/download")
public class AppDownloaderController {
@Autowired
InstallLinkJoinedService installLinkJoinedService;
@RequestMapping(value = "/link/{installLink}", method = RequestMethod.GET)
public String getInstallLink (Model model, @PathVariable("installLink") String installLink) {
InstallLinkJoined installLinkJoined = installLinkJoinedService.getInstallLinkWithID(installLink);
if (installLinkJoined != null) {
model.addAttribute("install", installLinkJoined);
}
return "download";
}
}
的HTML的问题一个片段:
<h3 class="achievement-heading text-primary" th:text="${install.projectName}"></h3><br/>
领域是InstallLinkJoined对象的一部分:
@Column(nullable = false)
private String projectName;
而且我有所有领域的获得者和制定者。
如果我注释掉违规行,我只是在下一个变量中得到异常。
而且,如前所述,在页面中的所有数据被显示出来如此明显的模型对象是不是空...
我缺少什么?
工作就像一个魅力! – AppCrafter