Eclipse
Making a Spring bean Applicationcontext aware
Suppose we have a webapplication with spring,
and we are initializing spring’s WebApplicationContext by configuring ContextLoaderListener in web.xml.
How can we get an instance of spring’s applicationContext object?
Possible solutions:
While configuring spring through web.xml the spring ApplicationContext object is set in the ServletContext.
To get ApplicationContext we say
ApplicationContext applicationContext = (ApplicationContext)servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
So we can get spring ApplicationContext [...]
How to contribute templates in the custom editor
The template feature is one of the most used features in Eclipse editors, providing auto-completion for the code syntax. When you type “for” in the Java editor and hit Ctrl + space you get the custom assist proposal for the completion of the for loop. It saves the developer’s time and also makes the [...]
Making applications work together in Eclipse
Eclipse as we know is a great implementation of plugin-architecture.
We decouple different components of a system into bundles.
plugin-architecture is very simplistic in nature, highly extensible and modular at the cost of a tricky class-loading policy.
Actually Eclipse is a story of several class-loaders.
It iniataites a chain of class loaders to load the plug-ins lazily as specified in component-specific manifest.mf files.
If we understand its class-loading policy and learn some tricks, then we can make different third-party jars talk to each other and avoid infamous ‘ClassNotFound Exception’.
