http://feeds.feedburner.com/SpendYourTimeHere-Once

Current Affiares

Monday, August 13, 2012

How to find the bean name in java jsf?

How to find the bean name in java jsf?

// in java file

@SuppressWarnings("unchecked")
    public static <T> T findBean(String beanName) {
        FacesContext context = FacesContext.getCurrentInstance();
        return (T) context.getApplication().evaluateExpressionGet(context, "#{" + beanName + "}", Object.class);
    }

// and how to use
// use below line wr u want to find the bean name & their respective values

BeanFile beanFile = javafile.findBean("user");

No comments:

Post a Comment

My Blog List

Popular Posts

All Rights Reserved To SYTHONCE. Ethereal theme. Powered by Blogger.