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
7
votes
1 answer

Why are expired @ViewScoped beans not destroyed until the session expires

I'm using Mojarra 2.2.4 on GlassFish 4 with Java 7. As I understand from BalusC's answer to How and when is a @ViewScoped bean destroyed in JSF?, @ViewScoped beans should be destroyed in three cases: Post-back with non-null outcome Session…
7
votes
2 answers

Exception - Unable to set property userLogin for managed bean credentials

For authentication purposes, I am injecting a request scoped backing bean into another session scoped bean that is going to store the logged user. Or at least it should... Following , a bit of code: Request scoped bean - managed…
Hari
  • 1,509
  • 15
  • 34
7
votes
3 answers

Creating session explicitly in requestScoped bean in JSF 2

I have a doubt here about creating session in requestScoped bean in JSF 2.x. I understand that we need not create session in JSF 2.x since we can directly use a sessionScoped bean to put the user required data. But I recently was introduced to a JSF…
h-kach
  • 351
  • 2
  • 8
  • 25
7
votes
2 answers

Injecting one view scoped bean in another view scoped bean causes it to be recreated

I need to use some data saved in a view scoped bean in an other view scoped bean. @ManagedBean @ViewScoped public class Attivita implements Serializable { // } and @ManagedBean @ViewScoped public class Nota implements Serializable { …
supertarmax
  • 111
  • 1
  • 4
  • 10
6
votes
1 answer

session scoped managed bean vs stateful bean vs httpsession

i need a way to save a user chosen configuration composed of different parts. each part is chosen on a separate page, from a list supplied by a managed bean (one per part type). now the fun part. i have a datatable, always visible, same for all…
glasspill
  • 1,290
  • 4
  • 21
  • 36
6
votes
1 answer

JSF Named Bean, Eager application scoped (aka @ManagedBean(eager=true) )

Is there any way to initialize Named Bean annotaded by javax.inject.Named/javax.enterprise.context.ApplicationScoped like @ManagedBean(eager=true) from javax.faces package? @Named @ApplicationScoped public Mail() { ... } I want to load this class…
vizzdoom
  • 736
  • 1
  • 9
  • 19
6
votes
2 answers

@PostConstruct didn't get called by JSF if ManagedBean is inside jar library

I'm running with the following problem. I have a few Managed Beans that are shared between, at this moment, two JSF applications. As I don't want to copy and paste the code in the two (more in the coming future) I've put this shared managed beans…
ebianchini
  • 73
  • 1
  • 1
  • 5
6
votes
3 answers

Using JSF EL in a plain HTML attribute

Can we use JSF EL inside a HTML tag? For example, inside a plain HTML element, can we use EL #{bean.color} for the bgcolor attribute?
greg
  • 237
  • 1
  • 4
  • 8
6
votes
3 answers

Listening to when the user session is ended in a JSF managed bean

Is it possible to do something like this: When a user session starts I read a certain integral attribute from the database. As the user performs certain activities in this session, I update that variable(stored in session) & when the session ends,…
Rajat Gupta
  • 25,853
  • 63
  • 179
  • 294
6
votes
1 answer

Concurrency of @ApplicationScoped JSF managed beans

I'm using Mojarra 2.2.12 and in our project we've got a few @ApplicationScoped beans. For instance: @ManagedBean @ApplicationScoped public class AppScopedBean{ private int commonValueForClients; //GET, SET public void evalNew(){ …
St.Antario
  • 26,175
  • 41
  • 130
  • 318
6
votes
1 answer

Using f:selectItems var in passtrough attribute

can I pass expressions to JSF 2 passthrough-attributes? the following code is not working. expression #{country.isoCode} is not evaluated.
Steve
  • 384
  • 1
  • 7
  • 17
6
votes
0 answers

Jmeter and JSF, managed bean method on commandLink action not invoked

I'm trying to stress a rather simple JSF web application, that uses authentication, jMeter never invokes an action method (in a managed bean) associated with a pressed button. The authentication with multiple users (loaded from a CSV file) works…
shlypse
  • 61
  • 1
  • 1
6
votes
1 answer

When is a managed bean constructor called?

When is a managed Bean constructor called? Is it called only once? Thank you!
Luciane
  • 259
  • 4
  • 23
6
votes
1 answer

immediate vs deferred evaluation for reading bean properties

I am still unclear about the use of JSF immediate evaluation vs deferred evaluation, mainly because the online examples almost never seem to use the former method. I have seen a fair amount of JSF Examples, including those contained in…
Student
  • 1,947
  • 2
  • 18
  • 25
6
votes
3 answers

Using jquery ajax to call a jsf managed bean method (an AjaxBehaviorEvent listener handler)

i would like to know if there is a way to fire a jsf managed bean method (with an AjaxBehaviorEvent type parameter: the same triggered when using f:ajax) directly by using a jquery ajax server request.By the way , i m a jsf developper and i didn't…
Bardelman
  • 2,176
  • 7
  • 43
  • 70