Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Dynamic class loading in fragment(How to load dynamically new classes in context)
Dynamic class loading in fragment [message #758657] Thu, 24 November 2011 01:54 Go to next message
TorTukiTu Mising name is currently offline TorTukiTu Mising name
Messages: 12
Registered: August 2011
Junior Member
HI all,

I am facing a new problem.

I have a web bundle. This web bundle is extended by a fragment which is containing new classes.

This fragment et loaded at runtime (added by user).

The problem is, I need to load beans from that fragment.

So I wish to do
String myFragmentNewBeanId = someBusinessService.getNewBeanId();
AppContextAware.getApplicationContext().getBean(myFragmentNewBeanId);


but getBean argument MUST be a final String....

Does someone here knows if it's possible to dynamically load a new bean by a non final String ?

Thanks.
Re: Dynamic class loading in fragment [message #758658 is a reply to message #758657] Thu, 24 November 2011 01:57 Go to previous message
TorTukiTu Mising name is currently offline TorTukiTu Mising name
Messages: 12
Registered: August 2011
Junior Member
Sorry,

I am a morron...


	public ICell getCell(String cellName){
		return (ICell)AppContextAware.getApplicationContext().getBean(cellName);
	}


Here is the solution.
Previous Topic:ClassNotFoundException when using bundled spring-context-support
Next Topic:Problems registering two servlets in a WAB
Goto Forum:
  


Current Time: Fri Aug 22 11:50:55 EDT 2014

Powered by FUDForum. Page generated in 0.02536 seconds