On 8/9/06, Adrian Mitev <[EMAIL PROTECTED]> wrote:
Thx for your answer Craig! Any suggestion how to add a bean in aplication scope from the ServletContextListener?
Your ServletContextListener receives a ServletContextEvent as a parameter. That object has a getServletContext() method to get the ServletContext for the current application ... with that you can simply call: ServletContext context = event.getServletContext(); context.setAttribute(FacesConstants.VIEW_MAPPER, new MyViewControllerMapper()); Remember that application scoped managed beans (from a JSF perspective) are just servlet context attributes (from a webapp perspective). When Shale tries to load the managed bean for this mapper (the first time it's needed), your implementation will already be there, so it will be used instead of the default one. --
Seeing is believing
Craig