How to add bean configuration file in an eclipse-based Spring project?

萝らか妹 提交于 2020-01-23 06:23:22

问题


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,

Figure: No Spring section here in the selection wizard

Figure: project structure

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.


回答1:


  1. Help > Eclipse market
  2. Type spring and search
  3. Find Spring IDE Roo Support and click install
  4. Accept terms and click finish
  5. Restart Eclipse
  6. File > New > Others > Spring > Spring Bean configuration file



回答2:


  • Go the Eclipse MarketPlace and search STS there

  • Install 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 .

Now you will be good to go.




回答3:


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



来源:https://stackoverflow.com/questions/36369958/how-to-add-bean-configuration-file-in-an-eclipse-based-spring-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!