Questions tagged [managed-bean]

"Managed bean" is a Java EE specific term for Javabean classes which are designed to act as a controller in some MVC application. They are often referred in context of JSF and CDI.

"Managed bean" is a Java EE specific term for Javabean classes which are designed to act as a controller in some MVC application. They are often referred in context of JSF and CDI.

1004 questions
9
votes
4 answers

Retrieve the web app root path in JSF Managed Bean

Im trying to access the example/web folder (see below in the image) in a jsf managed bean but cant seem to find a way to do it thx
hari
  • 599
  • 2
  • 7
  • 20
8
votes
1 answer

Java singleton class vs JSF application scoped managed bean - differences?

Is there a difference using a singleton class and an application scoped managed bean to hold application data? I need to lookup certain JNDI ressources such as remote bean interfaces and therefore I wrote myself a singleton to cache my references…
djmj
  • 5,579
  • 5
  • 54
  • 92
8
votes
3 answers

How to create and destroy CDI (Weld) Managed Beans via the BeanManager?

I'm trying to create instances of CDI managed beans using the BeanManager rather than Instance .select().get(). This was suggested as a workaround to an issue I've been having with ApplicationScoped beans and garbage collection of their dependents…
Ben Kirby
  • 904
  • 2
  • 11
  • 29
8
votes
1 answer

The type ManagedBean is deprecated

I just created a new maven project and Added a index controller. Then I used managedbean annotation. But I get this message The type ManagedBean is deprecated. So I tried for alternatives but I could not find any solutions. All the articles uses…
user1670773
8
votes
1 answer

Inject EJB bean from JSF managed bean programmatically

I have EJB stateless bean. How can I inject it to JSF managed bean by programmatic instead of @EJB annotation?
phanhongphucit
  • 547
  • 9
  • 20
8
votes
2 answers

Passing data between managed components in JSF

Is it actually possible to pass any data between managed components in JSF? If yes, how to achieve this? Could anyone provide any sample?
rasP
  • 83
  • 1
  • 1
  • 4
8
votes
1 answer

Can I use multiple managed bean in the same xhtml page?

when there are data that are repeated in several pages (reference example) Is that I can load into a single managed bean and I use several managed bean in the same page. What is its impact?
user2354035
8
votes
4 answers

How to access property of one managed bean in another managed bean

I have a managed bean (SessionScope as follow) @ManagedBean(name="login") @SessionScoped public class Login implements Serializable { private String userSession; public Login(){ } } In this managedbean, somewhere in the login function, i…
Slay
  • 1,285
  • 4
  • 20
  • 44
8
votes
2 answers

cannot create session after response has been committed

i am getting the following error on my application startup page load : SEVERE: Error Rendering View[/HomeTemplate/equityVolume.xhtml] javax.el.ELException: /HomeTemplate/equityVolume.xhtml @70,78 value="#{equityBean.scripList}":…
z22
  • 10,013
  • 17
  • 70
  • 126
7
votes
1 answer

Using negation in disabled attribute of h:selectBooleanCheckbox

Could someone please tell me how to use negation in the value of a component say checkbox to enable and disable it? I have to disable a checkbox when the value of a property (somevalue) in bean is false. like in
KaySee
  • 423
  • 3
  • 7
  • 20
7
votes
1 answer

Why should we make a SessionScoped ManagedBean thread safe in JSF?

I know that Application-Scope persists across multiple users, so it's obvious that we should make sure that all the ApplicationScoped ManagedBeans are thread safe. I also understand that we don't need to care about thread safety for a RequestScoped…
Bhesh Gurung
  • 50,430
  • 22
  • 93
  • 142
7
votes
5 answers

JSF 2 localization (managed bean)

I have a properties file for localization: foo=Bar title=Widget Application This is tied in as a resource-bundle in the faces-config: com.example.messages.messages
Zack Marrapese
  • 12,072
  • 9
  • 51
  • 69
7
votes
1 answer

@ManagedProperty with request parameter not set in a @Named bean

I've a CDI managed bean wherein I'd like to set request parameters as managed properties: import javax.inject.Named; import javax.enterprise.context.RequestScoped; @Named @RequestScoped public class ActivationBean implements Serializable { …
Milkmaid
  • 1,659
  • 4
  • 26
  • 39
7
votes
1 answer

how is the @RequestScoped bean instance provided to @SessionScoped bean in runtime here?

I am reading through this example in JBoss where a @RequestScoped bean backing up JSF page is used to pass the user credential information which is then saved in a @sessionScoped bean. Here is the example take from JBoss docs. @Named…
brain storm
  • 30,124
  • 69
  • 225
  • 393
7
votes
1 answer

WARNING: JSF1074: Managed bean named 'bean' has already been registered

I'm using mojarra JSF 2.2. The beans that we have defined are anotation based eg. @ManagedBean(name = "codeBean") @ViewScoped public class CodeRuleBean implements Serializable I am using tomcat 7.0.53 to deploy the same. However, I am getting a…
Ghosh
  • 81
  • 1
  • 4