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 / 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 |
Why is java more secure?
What is a j2ee container?
What is java 2 platform, standard edition (j2se)?
Which software is used for java?
Difference between save and saveorupdate?
What is the difference between session bean and entity bean ?
how dopost is secured than doget?
what is the main use of the RequestDispatch object, how we this in realtime project
Why frameworks are used in java?
How to call main class with in main class?
Explain connector architecture.
What do you understand by actionform?