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...



Since we can create managed bean by two ways as, we can define the bean name in faces-config.xml fi..

Answer / 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

More J2EE Interview Questions

Why is java more secure?

1 Answers  


What is a j2ee container?

1 Answers  


What is java 2 platform, standard edition (j2se)?

1 Answers  


Which software is used for java?

1 Answers  


Difference between save and saveorupdate?

1 Answers  


What is the difference between session bean and entity bean ?

1 Answers  


how dopost is secured than doget?

4 Answers   CGI,


what is the main use of the RequestDispatch object, how we this in realtime project

3 Answers  


Why frameworks are used in java?

1 Answers  


How to call main class with in main class?

2 Answers   IBM, Infosys,


Explain connector architecture.

1 Answers  


What do you understand by actionform?

1 Answers  


Categories