Questions tagged [backing-beans]
114 questions
95
votes
5 answers
How to provide a file download from a JSF backing bean?
Is there any way of providing a file download from a JSF backing bean action method?
I have tried a lot of things. Main problem is that I cannot figure how to get the OutputStream of the response in order to write the file content to. I know how to…

zmeda
- 2,909
- 9
- 36
- 56
62
votes
11 answers
Difference between managed bean and backing bean
I came across the terms "managed bean" and "backing bean" in several forums. Many people think both are the same. But, there seems to be a slight difference. Can any one help me to understand the exact difference between these two terms?

Krishna
- 7,154
- 16
- 68
- 80
46
votes
1 answer
Making Distinctions Between Different Kinds of JSF Managed-Beans
I recently read this article from Neil Griffin Making Distinctions Between Different Kinds of JSF Managed-Beans and it got me thinking about the distinction between different beans in my own application. To quickly summarise the gist:
Model…

Laurens
- 2,078
- 5
- 29
- 46
11
votes
2 answers
Passing the backing bean as a parameter to a Facelet include
I have a Facelet that might be used in different applications.
I don't to copy it, but reuse it. I need to pass the backing bean that will manage the view as a parameter, as some logic may vary according to the application where it is used in.
I…

Deibys
- 619
- 3
- 9
- 18
10
votes
1 answer
JPA Entity as JSF Bean?
Does it make sense to use Entities as JSF Backing Beans?
@Entity
@ManagedBean
@ViewScoped
public class User {
private String firstname;
private String lastname;
@EJB
private UserService service;
public void submit() {
…

Kayser
- 6,544
- 19
- 53
- 86
8
votes
2 answers
Conversion Error setting value '52' for 'null Converter'
I'm new to JSF and I have been trying to store data from a form that uses a h:selectOneMenu to get the category of a product. The h:selectOneMenu is being populated from the DB, however, when trying to store a product in the DB, I am getting an…

lv10
- 1,469
- 7
- 25
- 46
5
votes
3 answers
How to (or should you) avoid long methods/classes in jsf
I'm mostly working with legacy code in a JSF based project and there are lots of quite long classes and methods in backing beans.
This is constantly bugging me but when I look for what can be done, most of the time all I can come up is to divide a…

SelimOber
- 708
- 6
- 17
5
votes
4 answers
Calling a managed bean method when some button is clicked
I am new to JSF and want to have a button, which when clicked, will call a method of the backing bean. Is this possible or I have to use AJAX or something? I tried things like
But they…

Naman
- 2,363
- 5
- 26
- 27
4
votes
5 answers
Injecting EJB3.0 Beans into JSF2.0 Backing Beans... Impossible?
I'm working on a JSF project on Weblogic 11g, and our initial design is calling for JSF Backing Beans to invoke EJB3.0 beans to perform business logic and data access calls. The @EJB annotation doesn't seem to work in my project when I try to inject…

bakoyaro
- 2,550
- 3
- 36
- 63
4
votes
1 answer
ViewScope constructor called twice, not sure why
I've seen the other questions regarding calling a bean constructor and ViewScope, and I'm still having difficulty. The problem I'm seeing involves two specific pages in my application. The first is a dataTable (for now it is filled with randomly…

Sean
- 971
- 4
- 12
- 21
4
votes
1 answer
Backing bean organization in JSF
I have been thinking about this for a while now and have yet to come up with a best practice for how to organize my beans/classes in a JSF project for the presentation tier. Obviously there are many factors that come into play, but I would like to…

bhouse
- 115
- 2
- 7
3
votes
1 answer
set itemDisabled from backing bean method for each item in list
I have a radiobutton list and would like to disable some items according to the outcome of a backing bean method.

glasspill
- 1,290
- 4
- 21
- 36
3
votes
3 answers
JSF 1.2 when invoke bean method by h:commandButton, it does not works all the time
Recently, I have met a really weird problem. It is as follows:
In the save page of a typical CRUD workflow, clicking the h:commandButton to call the save method in backing end bean does not work all the time. Sometimes, it works as I expected…

Bo Ye
- 371
- 2
- 6
- 17
3
votes
1 answer
JSF property transfer from backing bean A to backing bean B
I'm getting deeper into JSF 2.0 at the moment and lacking a bit of understanding about the "transport" of managed bean properties from one view to the other. I searched a bit but haven't found a really good example, so if anyone could point me to a…

Christian Seifert
- 2,780
- 5
- 29
- 45
3
votes
1 answer
invoke method of @facescomponent of composite component
I need to invoke a method of backing component(@facescomponent) of composite component. I see others do this in articles but none of them has ever worked for me.
this how I invoke:

lazyCoding
- 481
- 2
- 5
- 13