小编Bla*_*ack的帖子

我不能在春天自动装箱

我试图使用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)

java spring spring-mvc noclassdeffounderror spring-data

11
推荐指数
1
解决办法
1万
查看次数

酶,ReactTestUtils和反应测试库之间的区别

酶,ReactTestUtils和用于反应测试的react-testing-library有什么区别?

ReactTestUtils文档说:

ReactTestUtils使您可以轻松地在您选择的测试框架中测试React组件。

酵素文件只是说:

Enzyme是一种用于React的JavaScript测试实用程序,使断言,操作和遍历React Components的输出变得更加容易。

React-Testing-Library文档:

react-testing-library是用于测试React组件的非常轻巧的解决方案。它在react-dom之上提供了轻量级的实用程序功能。

为什么实际上每个解决方案都更容易,而另一个解决方案却无法实现?

reactjs enzyme react-testing-library

11
推荐指数
4
解决办法
3497
查看次数

Thymeleaf未选择禁用选项

我正在使用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)

系统会自动选择捷克语,但我想查看选择您的选项

materialize thymeleaf

1
推荐指数
1
解决办法
3921
查看次数