eclipse 如何在基于eclipse的Spring项目中添加bean配置文件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/36369958/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to add bean configuration file in an eclipse-based Spring project?
提问by Arefe
I started to work on a Spring project from scratch and while I was trying to add a new Spring bean configuration file, I just don't see it there. The project structure and the selection wizard is as following,
我从头开始处理 Spring 项目,当我尝试添加新的 Spring bean 配置文件时,我只是在那里看不到它。项目结构和选择向导如下,
Figure: No Spring section here in the selection wizard
图:选择向导中没有 Spring 部分
How to add a bean configuration file in the project ? I tried to get a template and add in the project. However, I don't see the different tabs (such as, mvc, context etc ) in the file page. The maven dependencies are fine and it's dynamic web project. I also tried with maven-archetype-webapp as starting point of the project.
如何在项目中添加bean配置文件?我试图获取一个模板并添加到项目中。但是,我在文件页面中没有看到不同的选项卡(例如 mvc、context 等)。Maven 依赖关系很好,它是动态 Web 项目。我还尝试使用 maven-archetype-webapp 作为项目的起点。
回答by Vugar Asadov
- Help > Eclipse market
- Type spring and search
- Find Spring IDE Roo Support and click install
- Accept terms and click finish
- Restart Eclipse
- File > New > Others > Spring > Spring Bean configuration file
- 帮助 > Eclipse 市场
- 输入 spring 并搜索
- 找到 Spring IDE Roo Support 并点击安装
- 接受条款并点击完成
- 重启 Eclipse
- 文件 > 新建 > 其他 > Spring > Spring Bean 配置文件
回答by manoj kumar
1.Help > Eclipse market 2.Type spring and search 3.Find Spring Tools 3 Add-On for Spring Tools 4 and click install 4.Accept terms and click finish 5.Restart Eclipse 6.File > New > Others > Spring > Spring Bean configuration file
1.Help > Eclipse market 2.输入 spring 并搜索 3.Find Spring Tools 3 Add-On for Spring Tools 4 并单击安装 4.接受条款并单击完成 5.重新启动 Eclipse 6.File > New > Others > Spring > Spring豆配置文件
回答by chetan mahajan
Go the Eclipse
MarketPlace
and search STS thereInstall Spring Tool Suit
Then go to the window and select open perspective now you will be able to see spring perspective there.
After this right click on the
src/main/resources
Click on new and select other and search for spring configuration file
- Now you will see configuration xml file select it and name it with xml extension .
去 Eclipse
MarketPlace
并在那里搜索 STS安装弹簧工具套装
然后转到窗口并选择打开透视图,现在您将能够在那里看到弹簧透视图。
在此之后右键单击
src/main/resources
点击new并选择other并搜索spring配置文件
- 现在您将看到配置 xml 文件选择它并使用 xml 扩展名命名它。
Now you will be good to go.
现在你可以走了。