Skip to main content


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 06:54 Go to next message
TorTukiTu Mising name is currently offline TorTukiTu Mising nameFriend
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 06:57 Go to previous message
TorTukiTu Mising name is currently offline TorTukiTu Mising nameFriend
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: Wed Apr 24 15:05:21 GMT 2024

Powered by FUDForum. Page generated in 0.03347 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top