JSF : Mapping URL to backing bean method

Hi Anybody,

I am facing a problem to map a URL to a JSF backing bean method.

The idea is before the page loads there is some pre - population data to be got from Database and populated in the backing bean.

Any ideas please?

I have one way to do this by using PhaseListener and in after phase get the reference to the managed bean. then using

FacesContext facesContext = argEvent.getFacesContext();

nh = facesContext.getApplication().getNavigationHandler();

nh.handleNavigation(facesContext, null, myBean.myBeanMethod

);

Here myBean.myBeanMethod() returns a string using which we can do further navigation.

Get me the ideal way to do this.

[707 byte] By [vishwanathsuna] at [2007-11-26 14:53:18]
# 1
The MyFaces wiki has a few options for this: http://wiki.apache.org/myfaces/InvokingJsfPagesWithStandardUrls
guy.colemana at 2007-7-8 8:41:36 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Better if there is something we have with Sun's JSF implementation.

I had gone thru MyFaces earlier which has a way out to handle this.

Our design is already finalized to use Sun's JSF implementation, but, then portal integration was not a concern. Now it is there to add complexity.

vishwanathsuna at 2007-7-8 8:41:36 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
None of the options listed on the wiki page I pointed out require the MyFaces implementation.
guy.colemana at 2007-7-8 8:41:36 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...