java - 在 Intellij Ultimate 中为简单的 Spring 应用程序设置 applicationContext.xml
问题描述
我是 Spring 的新手,我正在尝试设置一个简单的 Spring 应用程序,我正在通过在线教程进行学习。然而,导师正在使用 Eclipse,而 IntelliJ 正在抱怨
Cannot find the declaration of element 'beans'.
....来自 applicationContext.xml
我唯一的 Spring POM 依赖项:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.1.9.RELEASE</version>
</dependency>
我的 applicationContext.xml
我是否必须从项目结构中的“构面”上下文菜单中进行设置?如果是这样,怎么做?
我拥有典型 Ultimate 安装中捆绑的所有标准 Spring 插件:
我的项目结构:
解决方案
除了 Spring Core,您还必须对 Spring Beans 使用以下依赖项。
<!-- https://mvnrepository.com/artifact/org.springframework/spring-beans -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>5.1.9.RELEASE</version>
</dependency>
推荐阅读
- android - 安装时将图像存储在应用程序数据文件夹中
- authentication - 通过 ssh 而没有 root 编辑数据库的用户权限
- node.js - npm install 时在 node_modules 中创建的 .staging 文件夹
- reactjs - 关注 Redux 表单中 Enter 上的下一个输入字段
- java - 如何将文件从文件夹移动到文件夹
- continuous-integration - 在 BitBucket Pipelines 中标记特定分支
- razor - 在非必填字段上触发 asp.net 核心不显眼的验证
- javascript - 将屏幕高度从 javascript 传递给 php
- django - 在 django 中使用 css 渲染表单
- elasticsearch - ElasticSearch 匹配查询问题