If the input fields of the (JSF) form are bound to a managed bean then the user state is automatically synchronized with the bean properties.
Can I use an Entity class as a managed bean? (If this is possible, I don't need to create a separate managed bean & simply persist the Entity instance with the data entered by the user to the database using JPA)
Yes, sure. But this would be a bad practice since you shouldn't fill your ejbs with front-end garbage. And if you don't, the desing pattern will force you to fill you RAM with ejbs saved in session which leads to out-of-mem errors and server crashes. My recommendation would be to leave ejbs as they are and create controller managed bean filled with action methods where you would only instantiate ejbs. If you have trouble accesing Facade methods there just use @EJB annotation when declaring facade objects (ie @EJB MyClassFacadeLocal myClassFL;).
Wanna install linux on a vacuum cleaner. Could anyone tell me which distro sucks better?
Joined: Mar 10, 2004
What I mean by Entity class in not regarding EJB but regarding JPA.
Why should we? So you can argue more? That will get you no where around here. Have you searched this forum as suggested by Tim? If not, please do so. As he said, this question has been answered multiple times before. And even so, the short answer is you can do it, but it is bad practice and and anti-pattern. So simply, don't do it.
Most of what I've got here, I found by just paging back over postings for the last month or 2 and looking at likely topic names. I think there may be some others that go into more detail, but they're not immediately recognizable.