spring_reference/VII. Spring Boot CLI/55.1.3. Default import stat...

6 lines
418 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

### 55.1.3. 默认import语句
为了帮助你减少Groovy代码量一些`import`语句被自动包含进来了。注意上面的示例中引用`@Component``@RestController`和`@RequestMapping`而没有使用全限定名或`import`语句。
**注**很多Spring注解在不使用`import`语句的情况下可以正常工作。尝试运行你的应用看一下在添加imports之前哪些会失败。