Questions tagged [backing-beans]
118 questions
91
votes
4 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…
![](../../users/profiles/613461.webp)
zmeda
- 2,843
- 8
- 34
- 56
61
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?
![](../../users/profiles/421753.webp)
Krishna
- 6,706
- 15
- 64
- 79
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…
![](../../users/profiles/838545.webp)
Laurens
- 2,068
- 5
- 25
- 45
10
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…
![](../../users/profiles/1997828.webp)
Deibys
- 531
- 1
- 8
- 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() {
…
![](../../users/profiles/643271.webp)
Kayser
- 6,116
- 17
- 49
- 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…
![](../../users/profiles/1175892.webp)
lv10
- 1,229
- 6
- 24
- 45
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…
![](../../users/profiles/610501.webp)
SelimOber
- 698
- 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…
![](../../users/profiles/459387.webp)
onlinenaman
- 2,343
- 5
- 24
- 26
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…
![](../../users/profiles/455020.webp)
bakoyaro
- 2,502
- 3
- 33
- 56
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…
![](../../users/profiles/532962.webp)
Sean
- 929
- 4
- 11
- 20
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…
![](../../users/profiles/1667393.webp)
bhouse
- 95
- 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.
![](../../users/profiles/1022043.webp)
glasspill
- 1,259
- 3
- 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…
![](../../users/profiles/627910.webp)
Bo Ye
- 301
- 6
- 15
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…
![](../../users/profiles/2963863.webp)
Christian Seifert
- 2,562
- 5
- 23
- 42
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:
![](../../users/profiles/3354638.webp)
lazyCoding
- 411
- 1
- 5
- 12