[jboss-user] [JBoss Seam] - Re: ResourceBundle in Database

Zerg-Spirit do-not-reply at jboss.com
Tue Jul 3 09:21:43 EDT 2007


Sorry for the triple post, but I just found something strange to me.*
I actually managed to call the @Create method by calling the bean on the jsf page (I simply put an outputText with a property of my Bean as value).
Since I've done that, the @Create method is now called, apparently the bean is 'created' when it reaches that jsf tag.
But then, I've got apparently two different instance of my DBResourceBundle.

@Create
  | 	public void fillAvailableResourceBundle(){
  | 		try{
  | 			availableResourceBundles = em.createQuery("select rb from CustomResourceBundle rb").getResultList();
  | 			System.out.println("Found "+availableResourceBundles.size()+" custom resource bundles");
  | 		}
  | 		catch(Exception e){
  | 			
  | 			e.printStackTrace();
  | 			
  | 		}
  | 
  | 		
  | 	}
When that method is called, it finds my 'CustomResourceBundles in the db.

But then, when I put messages['something'] in the jsf page, the method handleObject of the same class is called, and the availableResourceBundles is null for it, aswell as my Injected EntityManager, although it was used just before in the @Create method withtout any problem!
Like if there was 2 different instances of my class.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059957#4059957

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4059957



More information about the jboss-user mailing list