I read some post hear (specially BalusC post) and googled for the reason (not deep) but i couldn't find why shouldn't use entity bean as a managed bean. what's the reason? (I'm learning from "Pro JSF and HTML5" and in this book, entity bean is used as a managed bean.)
why shouldn't entity bean be managed by JSF framework?
422 Views Asked by Arash At
1
There are 1 best solutions below
Related Questions in JSF
- Strange java.lang.ArrayIndexOutOfBoundsException rendering error in jsf application under high load
- h:outputStylesheet inside ui:repeat
- IntelliJ warns "Cannot resolve variable" on EL variables declared in parent page of include
- How to instantiate a backing bean on page load
- How to disable default keyCode event in Primefaces?
- How to define a style for ul which appears automatically
- How to add '%' symbol in textbox using jsf and jsp?
- Primefaces onkeyPress triggerevent
- h:commandButton action method is not invoked
- f:ajax resetValues="true" does not seem to work
- Primefaces datatable duplicate "No records found" while doing column freeze for empty records
- How to provide a file download from a JSF backing bean using af:commandMenuItem?
- Remove message from h:outputText ofter time
- How to change the position of confirmation box in jsf primefaces?
- commandLink not working when images are in same line
Related Questions in MANAGED-BEAN
- How to instantiate a backing bean on page load
- Expire specific managed bean instance after time interval
- Unit-testing bean-initialization
- Spring managed bean subclass can't access protected service from superclass
- Can @ManagedBean and @XxxScope be placed in a base class?
- Sessionscoped managed bean not saving variables jsf
- Disable scanning of CDI beans in WAR
- action p:command button doesn't set property into managed bean
- null bean in selectOneMenu
- How to set bean class at runtime
- How to set a value to a bean property from a JavaScript async callback
- JSF - Using different instances of ManagedBean for same view in Primefaces wizard
- Set actionListener of primefaces CommandButton object in managed bean using binding
- How to use enum with switch statement?
- valueChangeListener isn't always triggered depending on the rendered attribute
Related Questions in ENTITY-BEAN
- @Size annotation not trimming whitespace
- how to use spring to inject EntityBean on EJB 2.1 version using version 2.5 for JDK1.4
- WAS 8.5.5 CMP/BMP and Persistence DataSource
- Java EE Glassfish error compiling non existing named query
- Create Entity Class from Remote Database (through connection)
- Can I get something like an entity bean in EJB 3.2?
- CMP entity bean in OpenEJB (OpenJPA?)
- How do i connect to mysql data base with EJB entity bean?
- EntityManager identifier generation exception?
- creating entity beans
- Create entity bean from existing Database through glassfish resource (connection pool)
- Auto Increment Using @ Generated
- Bean-Managed EB3 with jdbc persistency
- How to refresh EJB 2.1 entity bean after changes made by JDBC in the same transaction?
- when is an EJB CMP entity bean actually created
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Separation of concerns.
Normally, enterprise applications are developed and deployed as EARs instead of WARs. A typical EAR project consists of an EJB subproject as "back-end" and a WAR subproject as "front-end". The EJB subproject contains all JPA entities and EJB services. The WAR subproject contains all JSF managed beans and views (and what not closely related to JSF such as converters, validators, phase listeners, etc).
A good EJB subproject may not have any dependency on JSF. This makes it reusable for different front-ends, such as Spring MVC, JAX-RS, Struts2, plain JSP/Servlet or even a desktop oriented Swing application. This also means that no one of your JPA entities and EJB services should have any
javax.faces.*import/dependency in the class. Having for example aFacesContextat hands inside a JPA entity or EJB service is alarming as that doesn't necessarily exist in other front-ends.The "Pro JSF and HTML5" concentrates on simple WAR projects. Therein that's "okay" in order to show the possibilities and/or to keep the examples "simple", but that's actually misleading to starters once they grow into developing enterprise applications, the more so if the book doesn't cover the design concern in detail.
See also: