adspace


Since we can create managed bean by two ways as,
we can define the bean name in faces-config.xml file so that
page can use that OR we can write annotation on bean class
so
that it is automatically assign to page but I want to know
which one is good programming practice ?

And also mention disadvantage of other which should not
prefer
...

Thanking you...

Answer Posted / Rajkumar Paswan

Using annotations (@ManagedBean and @SessionScoped, etc.) on the bean class is considered a better practice in modern J2EE development as it promotes code simplicity and eliminates the need for XML configuration files. However, using faces-config.xml can be useful when managing complex applications with multiple beans.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

i want test pattern of zylog company and some examples also

2869