i have a few application context files for an application. I want to view graphically the dependencies between them.
Is there a free plugin in eclipse or some viewer?
Thanks!
To get a reference to the ApplicationContext in a Spring application, it can easily be achieved by implementing the ApplicationContextAware interface. Spring will automatically detect this interface and inject a reference to the ApplicationContext: view rawMyBeanImpl. java hosted by GitHub.
We use the FileSystemXMLApplicationContext class to load an XML-based Spring configuration file from the file system or from URLs. This class is useful when we need to load the ApplicationContext programmatically.
ApplicationContext is a corner stone of a Spring Boot application. It represents the Spring IoC container and is responsible for instantiating, configuring, and assembling the beans. The container gets its instructions on what objects to instantiate, configure, and assemble by reading configuration metadata.
You can go for getApplicationContext() if you wanna get context of whole application. If you want to get context of current class you can use getBaseContext() instead.
The Spring Tool Suite has an editor (Spring Config Editor) to edit the spring context xml files. This Editor can also draw a diagram of the beans (the tab "Beans Graph" of that editor -- see the image below.).
When I remember right, then this functionality is also included in the Eclipse Spring IDE Plugin.
There's also the Spring Bean Doc project, although it's a bit long-in-the-tooth. I have not used it with Spring 3, so I can't speak for its efficacy for recent versions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With