开发者

Content Assist not working in applicationContext.xml with Java Project with 'Spring Project Nature' in eclipse

开发者 https://www.devze.com 2023-02-19 22:29 出处:网络
I ha开发者_StackOverflow社区ve a simple Java project using Spring 3 and Hibernate 3. I\'ve added the \"Spring Project Nature\" using Spring IDE. The applicationContext.xml file is in the src folder o

I ha开发者_StackOverflow社区ve a simple Java project using Spring 3 and Hibernate 3.

I've added the "Spring Project Nature" using Spring IDE. The applicationContext.xml file is in the src folder of the project.

The Content Assist feature of Eclipse 3.5 doesn't seem to work in applicationContext.xml:

  • Inside the class attribute of bean tag it can't seem to find the packages and classes in my Java Project.
  • It can't assist with any attribute, like finding existing beans in applicationContext.xml for the ref attribute.


  1. Project Properties > Spring > Bean Support > Config Sets > Add New Group (contains all configuration files). Then open applicationContext.xml again.
  2. If content assist does not work, try opening the related file with Spring Config Editor.
  3. If Project Properties > Spring in step 1 doesn't exist, install:

    • SpringSource Tool Suite: Core/STS > SpringSource Tool Suite (required)
    • Additional extensions if needed, e.g. AOP, Autowire, Security.


Spring IDE and STS only complete Java class and package names after at least one character has been typed into the class or corresponding attributes.

If you want to get content assist for Bean references by name across XML files you need to define a Config Set (Project Properties > Spring > Bean Support > Config Sets).


To enable content assist for a spring project in Eclipse,
go to Projects->Properties->Spring->Config Detection and select all the options for auto detection.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号