我试图使用spring注释在控制器中自动装配存储库.我收到错误org.springframework.data.repository.query.QueryByExampleExecutor class not found,我无法找到解决方案.
我得到的错误:
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'articleController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.payforeign.article.ArticleRepository com.payforeign.article.ArticleController.repository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'articleRepository': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/data/repository/query/QueryByExampleExecutor
Run Code Online (Sandbox Code Playgroud)
调节器
package com.payforeign.article;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping("/service")
public class ArticleController {
@Autowired
private ArticleRepository …Run Code Online (Sandbox Code Playgroud) 酶,ReactTestUtils和用于反应测试的react-testing-library有什么区别?
ReactTestUtils文档说:
ReactTestUtils使您可以轻松地在您选择的测试框架中测试React组件。
酵素文件只是说:
Enzyme是一种用于React的JavaScript测试实用程序,使断言,操作和遍历React Components的输出变得更加容易。
React-Testing-Library文档:
react-testing-library是用于测试React组件的非常轻巧的解决方案。它在react-dom之上提供了轻量级的实用程序功能。
为什么实际上每个解决方案都更容易,而另一个解决方案却无法实现?
我正在使用Materializecss选择表单http://materializecss.com/forms.html#select,它要求禁用第一个选项并选择正确的行为。Thymeleaf会忽略已禁用的选项,尽管它已被选中。而是选择第一个非禁用选项。
<div class="input-field col s6">
<select th:field="*{locale}" th:errorclass="invalid">
<option value="" selected="selected" disabled="disabled">Choose your option</option>
<option value="cs">Czech</option>
<option value="en">English</option>
</select>
<label>Locale</label>
</div>
Run Code Online (Sandbox Code Playgroud)
系统会自动选择捷克语,但我想查看选择您的选项。
enzyme ×1
java ×1
materialize ×1
reactjs ×1
spring ×1
spring-data ×1
spring-mvc ×1
thymeleaf ×1