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
40
votes
2 answers

Pass input text value to bean method without binding input value to bean property

Can I pass a input text field value to a bean method without binding the value to a bean property?
membersound
  • 81,582
  • 193
  • 585
  • 1,120
38
votes
4 answers

How do I process GET query string URL parameters in backing bean on page load?

I've read how to send parameters using JSF but what if the user types their companyId in the URL when accessing their login page? For example, http://my.company.url/productName/login.faces?companyId=acme. The way we do it now, there is a bit of…
Big Al
  • 481
  • 1
  • 7
  • 14
32
votes
3 answers

How can I get a message bundle string from inside a managed bean?

I would like to be able to retrieve a string from a message bundle from inside a JSF 2 managed bean. This would be done in situations where the string is used as the summary or details parameter in a FacesMessage or as the message in a thrown…
Jim Tough
  • 14,843
  • 23
  • 75
  • 96
30
votes
3 answers

Calling Primefaces dialog box from Managed Bean function

Hi I have a managed bean with some functions , based on some condition in that function I will like to call a dialog box Managed bean function goes as public String editStudent(){ setReadOnly(false); setButton(true, true, true,…
NKS
  • 1,140
  • 4
  • 17
  • 35
25
votes
1 answer

How to set -Dorg.apache.el.parser.COERCE_TO_ZERO=false programmatically

This question is similar to: jsf: integer property binded to a inputtext in UI is set to zero on submit but I am not completely satisfied with the solution. The contexts is the same: I have a web form requiring an Integer value. If the textbox is…
Steve
  • 11,831
  • 14
  • 51
  • 63
23
votes
3 answers

How to pass JavaScript variables as parameters to JSF action method?

I'm preparing some variables in JavaScript (in my specific case, I'd like to get GPS location): function getVars() { // ... var x = locationInfo.lng; var y = locationInfo.lat; } I'd like to send them to my managed bean via the below…
Bubble
  • 327
  • 2
  • 4
  • 13
22
votes
1 answer

@javax.faces.bean.ManagedProperty in CDI @Named bean returns null

I'm trying to deal with @javax.faces.bean.ManagedProperty but without success ! I've been following this guide, and it not seems that hard. But my code simply won't work! Here's a little snippet @ManagedBean @SessionScoped public class LoginBean { …
StepTNT
  • 3,867
  • 7
  • 41
  • 82
20
votes
1 answer

JSF managed-bean EJB injection

I have an EJB (PersonManager) in the Enterprise Application modul, which injects another EJB (Person): @Stateful public class PersonManager implements PersonManagerLocal { @EJB private PersonLocal person; @Override public void…
Forty
  • 420
  • 1
  • 5
  • 10
20
votes
1 answer

JSF managed bean naming conventions

These days I used to work with JSF, but there's a "convention" I'm in doubt if I should use. While working with managed beans, people used to name it as XxxxxManagedBean where the prefix can be any name related to your business. Have you worked like…
axcdnt
  • 14,004
  • 7
  • 26
  • 31
20
votes
3 answers

Target Unreachable, identifier resolved to null in JSF 2.2

I have a problem with JSF 2.2 and CDI, my managerbean is not solved and this error appear "value="#{userBean.user.name}": Target Unreachable, identifier 'userBean' resolved to null" This is my manager bean. @ManagedBean @RequestScoped public…
SaXeTz
  • 500
  • 1
  • 3
  • 14
19
votes
2 answers

How does JSF find beans annotated with @ManagedBean?

As far as I know, for using @Annotations (or [Attributes] in C#) you have to have a reference to the class metadata, so that you can ask if the class is annotated (attributed) or not. My question is how does JSF implementation find all classes…
Iravanchi
  • 5,139
  • 9
  • 40
  • 56
18
votes
2 answers

Access session scoped JSF managed bean in web filter

I have SessionScoped bean called userSession to keep track of the user ( username, ifLogged, etc). I want to filter some pages and therefore I need to access the bean from the webFilter I created. How do I do that? I looks like its even impossible…
user1997553
  • 233
  • 1
  • 2
  • 10
17
votes
6 answers

Java EE 6: Target Unreachable, identifier 'helloBean' resolved to null

I am trying to get a simple JSF 2 tutorial example to work. I am using the dynamic web project in Eclipse and publishing to a Glassfish 3 server (run -> run on server). The first index.xhtml page loads correctly, but when I have to access a managed…
Lou Rous
  • 241
  • 1
  • 3
  • 5
17
votes
1 answer

How to get managedbean property from another bean in JSF

I searched similar questions but I'm a bit confused. I have a login page, so LoginBean also which is; @ManagedBean(name = "loginBean") @SessionScoped public class LoginBean implements Serializable { private String password=""; private…
asyard
  • 1,743
  • 5
  • 21
  • 43
17
votes
1 answer

What is a managed bean and how many should I use per page?

I am working on a Web-application using JavaServer Faces. I have found many examples and tutorials on how to use JavaServer Faces, but none of them actually explain what a Bean is used for. My initial thoughts were, that Beans represent forms. You…
Xandaros
  • 645
  • 1
  • 6
  • 17
1
2
3
66 67