Malina Kirn
Malina Kirn

Reputation: 2253

Eclipse: open declaration/resource for spring beans and contexts

While watching one of my colleagues work in IntelliJ, I was jealous to note that he could Ctrl/Command+Click on the name of a spring bean, context, or resource in either a Java annotation or a Spring context file and IntelliJ would open the backing declaration or file.

I've installed the STS suite of plugins for Eclipse, but this has only given me the ability to open declarations for beans referred to in a spring context file. E.g., command+click only works in my context file for: <bean ... ref="bean-name"/>.

Specifically, things I can't open the declaration/resource for automatically are:

Surely there's a way in Eclipse to automatically discover declarations or resources for spring beans and contexts as they are used in both Java annotations and context files?

Upvotes: 2

Views: 1747

Answers (1)

Malina Kirn
Malina Kirn

Reputation: 2253

I found a solution for my first example, specifically, finding a spring resource imported into a spring context file in this StackOverflow question. Specifically, in the project properties under Spring->Beans Support, select the checkbox for Enable support for <import /> element in configuration files.

This also gives the ability to open bean declarations for beans defined in imported spring resource files.

I have yet to discover similar functionality for Java files that wire in Spring resources and beans via annotations.

Upvotes: 1

Related Questions