myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jerome Iffrig \(Europe\)" <Jerome.Iff...@eu.didata.com>
Subject RE: get a Spring bean in one of my AJAX component (e.g. inputSuggestAjax)
Date Thu, 21 Jun 2007 09:14:07 GMT
 
Thanks lots for your explaination and the snipet Cagatay, I'll get rid of jsf-spring... However
my issue here seems to be that in my specific case (the inputSuggestAjax component), the callback
method specified by the attribute suggestedItemsMethod of the tag must be a method with the
following prototype:-
public List getAListToFillSuggestions(String keyword) {

...

}

Note that the FacesContext is not an argument of this method, and I have no idea on how to
get an handle on it ...   any idea? I am stuck ...
 
Thanks
 

________________________________

From: Cagatay Civici [mailto:cagatay.civici@gmail.com] 
Sent: mercredi 20 juin 2007 23:47
To: MyFaces Discussion
Subject: Re: get a Spring bean in one of my AJAX component (e.g. inputSuggestAjax)


Hi,

Actually I prefer spring's builtin stuff for jsf integration and think of jsf-spring a bit
unnecessary dependency.

Anyway you can try spring's FacesContextUtils;

http://www.springframework.org/docs/api/org/springframework/web/jsf/FacesContextUtils.html

Use as;

FacesContextUtils
     .getWebApplicationContext(FacesContext.getCurrentInstance())
     .getBean("sopranoBean");

Regards,

Cagatay


On 6/21/07, Jérôme Iffrig <jerome.iffrig@hotmail.com> wrote: 

	Hi,
	
	The following question may sound very specific and not really related to
	MyFaces, but it would help me answer a question I have troubles to formulate
	...
	
	How can I access my Spring beans from the method defined as my 
	suggestedItemsMethod method in a "s:inputSuggestAjax" component?
	
	Note, if it helps, that I use jsf-spring as my glue between Spring and
	MyFaces. It works great, but not for such Ajax components...
	
	Thanks
	
	_________________________________________________________________
	Express yourself instantly with MSN Messenger! Download today it's FREE!
	http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
	
	



Mime
View raw message