package com.shaun.spring.config;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@ComponentScan("com.shaun.spring")
@EnableTransactionManagement
public class ApplicationContextConfig {
// @Bean configurations go here...
}
Run Code Online (Sandbox Code Playgroud)
我对@EnableTransactionManagement 有问题,发生的以下错误是:EnableTransactionManagement 无法解析为类型。
我的 pom.xml 中有以下依赖项:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
我也尝试过使用以下导入:
import org.springframework.transaction.annotation.EnableTransactionManagement;
Run Code Online (Sandbox Code Playgroud)
这给了我以下错误:
The import org.springframework.transaction.annotation.EnableTransactionManagement cannot be resolved
Run Code Online (Sandbox Code Playgroud) 我正在尝试验证正在发送到我的控制器的json,并且我正在使用BindingResult方式,我能够正常验证字符串和其他所有内容.但我不知道如何检查枚举是空还是空.