What is the method of controlling scope in Java EE projects. I’m reading about session, request, application scope and that certain beans should be limited to one or the other. How is this generally done? Is it by what type of project the bean is created in, a special annotation, or some other method? In my experience I’ve noticed that when outside of the same package none of my beans, servlets or DAO’s have access to each other unless I inject or import the related class.
Share
I think you are mixing things. The scopes you listed are for JSF backing beans and are generally related to the HTTP session or request. EJB-s has no scope in this context. To use them they have to be injected using DI annotations (or alternatively via JNDI context lookup).