This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
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, technically you can, but it's not very flexible. Scan back through this forum over about the last 2 weeks and you'll see that the question has been asked (and answered) before.
Customer surveys are for companies who didn't pay proper attention to begin with.
Namitha karupaiya
Ranch Hand
Joined: Mar 10, 2004
Posts: 89
posted
0
Please post the links of the relevant threads.
Namitha karupaiya
Ranch Hand
Joined: Mar 10, 2004
Posts: 89
posted
0
No reply?!
Akaine Harga
Ranch Hand
Joined: Nov 03, 2009
Posts: 68
posted
0
Can I use an Entity class as a managed bean?
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?
willCodeForFood("Java,PHP,C#,XML,VBS,XHTML,CSS,JavaScript,SQL"); //always looking for job opportunities in AU/NZ/US/CA/Europe :P
Namitha karupaiya
Ranch Hand
Joined: Mar 10, 2004
Posts: 89
posted
0
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.
Namitha karupaiya
Ranch Hand
Joined: Mar 10, 2004
Posts: 89
posted
0
Hi Gregg Bolinger,
I searched but could not find. PLEASE post the links of the relevant thread(s), if you are able to find them. (Please treat this as discussion, not argument!)
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.