Linked Questions
256 questions linked to/from Why JSF calls getters multiple times
7 votes
2 answers
11k views
Why is BackingBean method called multiple times when requesting facelet? [duplicate]
I'm working and learning about JSF + Facelets these days. I have a BackingBean and a Facelet xHTML page. When I request the facelet-page (only one time) the backing-bean-method is called multiple ...
0 votes
2 answers
556 views
c:forEach.items getting repetitively called [duplicate]
Environment: Seam, Richfaces The following code snippet causes the method getUsers to be called multiple times, how do I avoid this in my application so that it gets called only once. <c:forEach ...
1 vote
1 answer
935 views
JSF getter method called many times [duplicate]
I am using "c:forEach" in an xhtml in the following way: <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java....
0 votes
1 answer
1k views
Why does Table Component in ADF iterates many times over method bound to value attribute [duplicate]
In my ADF project , I have a table component on JSF page whose value attribute is bound to method in Managed bean which returns List type object . I am able to show the data on the table but i can see ...
0 votes
0 answers
808 views
JSF DataTable value get from method [duplicate]
Can I get value of DataTable in JSF from method that will return a list of objects instead of getting from getter of an attribute? FilmBean.java @ManagedBean(name = "filmBean") @SessionScoped public ...
0 votes
1 answer
701 views
Getter gets called as many times as there are values in ArrayList for h:dataTable and Eclipse says "Method must have signature "String method ..." [duplicate]
I'm really new to JSF, I've been learning it exactly 2 days now. Besides the initial confusion about the concepts, I have issues with eclipse too. I'm using JSF 2.0 with obviously Eclipse and Tomcat 7....
0 votes
1 answer
382 views
Did jsf <h:datatable> fetch data two times? [duplicate]
I'm using JSF 2.0. I wanted to use h:dataTable and I realized that the function from value in dataTable is invoked 2 times when I open view in browser. I'm confused with that and I don't know what I'...
0 votes
0 answers
430 views
ui:repeat within or inside ui:repeat not work [duplicate]
I have a problem using a <ui: repeat> inside another <ui: repeat>. Let's see the code to explain it better: <h:form> <ui:repeat value="#{myManagedBean.listDocsFather}" var="...
1 vote
1 answer
420 views
why values in <p:selectOneMenu> are duplicated after changing language in jsf? [duplicate]
I used for internationalization the JSF configuration, and I have a list of countries from the class Locale in <p:selectOneMenu>, but I am facing a problem of duplicate values of the countries ...
1 vote
1 answer
241 views
checkbox click executes many hibernate queries [duplicate]
I'm using Jboss. I have a bunch of checkboxes which I generated via a producer(@Named, @SessionScoped), the data comes from a mysql database (using hibernate). When I click a checkbox I print out (p:...
1 vote
0 answers
191 views
Why does ui:repeat make my application slow, and how can I fix it? [duplicate]
I have a primefaces wizard containing a ui:repeat, as follows: <p:wizard flowListener="#{reportWizard.onFlowProcess}" widgetVar="wiz" showStepStatus="false" showNavBar="false"> <p:tab id=...
0 votes
2 answers
101 views
Unexpected JPA SELECT statements logged when JSF page submitted [duplicate]
I'm using Glassfish Server 4.1 with bundled JSF. I've enabled JPA FINE logging in "persistence.xml". I have this Facelets page: <p:dataTable var="customer" value="#{customerService.customers}">...
0 votes
0 answers
51 views
Primefaces dataTable with commandButton send multiple request to hibernate [duplicate]
I am new with Primifaces and JSF framework I am using PRimefaces 5, JSF 2, Spring 4 and Hibernate 5 The problem that I am facing is that when adding a button into dataTable the number of request to ...
0 votes
0 answers
42 views
JSF Methods: multple calls without loading at startup [duplicate]
Currently, I try to make a game based on JSF 2.x with XHTML, JavaScript and Java as back-end. This game is round based with up to 6 players. Creating player (objects) and make some settings on it (...
0 votes
0 answers
40 views
load items for primefaces datatable - I need help to improve my code [duplicate]
I have currently the following code: <h:form id="activitiesListForm" rendered="#{activitiesRequestByObjectController.init('BOOKING_DATE', bookingDateEditController.bookingDate.id)}"> &...
0 votes
0 answers
27 views
JSF rendered methods executed on ajax requests [duplicate]
I need some light about something strange we have noticed in our project. We have a Primefaces 10 (Omnifaces) + JSF 2 project and we see that when we click a button (or trigger an AJAX request) log ...
0 votes
0 answers
26 views
Code Of Block Execute Multiple Time in jsf and jboss server [duplicate]
i am working on big web application which is developed in java, using jsf framework, running on jboss server. I face a problem: I have a function in which we call some soap web services. This works ...
0 votes
0 answers
23 views
How to stop jsf download link reloading page? [duplicate]
I am showing list of reports in my web page by iterating list of objects using h:datatable. Here is the code for that <p:dataTable emptyMessage="#{msg.reports_message}" var="fileData" value="#{...
0 votes
0 answers
19 views
Strange behaviour with primefaces datetable nested on JSF portlet [duplicate]
On a Liferay plugin project I've got a JSF+PF based portlet on which I've created a minimal, complete, and verifiable example dealing with <p:dataTable> and <p:rowExpansion> elements ...
0 votes
0 answers
20 views
Why the getters in JSF2 Bean class are getting invoked even before submitting the Form elements? [duplicate]
I have a simple JSF2.0 from page as shown below: <h:body> <div><center><h1><big><u>Java Learning Center</u></big></h1></center></...
79 votes
5 answers
160k views
How to populate options of h:selectOneMenu from database?
I am creating a web application, where you have to read a list of objects / entities from a DB and populate it in a JSF <h:selectOneMenu>. I am unable to code this. Can someone show me how to do ...
69 votes
4 answers
128k views
Invoke JSF managed bean action on page load
Is there a way to execute a JSF managed bean action when a page is loaded? If that's relevant, I'm currently using JSF 1.2.
57 votes
4 answers
99k views
Display dynamic image from database or remote source with p:graphicImage and StreamedContent
I'm trying to display image bytes which is saved in database as a StreamedContent in the <p:graphicImage> as follows: <p:graphicImage value="#{item.imageF}" width="50" id="grpImage" height=...
66 votes
2 answers
98k views
Defining and reusing an EL variable in JSF page
Is it possible to define variable and reuse the variable later in EL expressions ? For example : <h:inputText value="#{myBean.data.something.very.long}" rendered="#{myBean.data.something....
31 votes
3 answers
19k views
JSF -- <ui:repeat /> over a java.util.Set?
Does the <ui:repeat /> tag support iterating over a java.util.Set? I've tried iterating over my JPA domain entity objects contained in a Set, but receive errors. Is there something I'm missing?...
43 votes
2 answers
34k views
JSF Controller, Service and DAO
I'm trying to get used to how JSF works with regards to accessing data (coming from a spring background) I'm creating a simple example that maintains a list of users, I have something like <h:...
23 votes
6 answers
45k views
java.lang.IllegalStateException: CDATA tags may not nest
I've got a problem with an ajax request in a JSF page. When I click on the button, I get this exception: SEVERE: Servlet.service() for servlet Faces Servlet threw exception java.lang....
10 votes
3 answers
38k views
javax.persistence.TransactionRequiredException in small facelet application
I'm trying to persist some values to a MySql database from a small facelet application but keep getting this error. I had this same application with a JPS page and a servlet and it worked fine with ...
12 votes
5 answers
33k views
Initialization of List in a JSF Managed bean
I' have a question about initialization of List in the POJO as it follows the next code: public class Person { //other fields... private List<String> friends=new ArrayList<>(); ...
20 votes
2 answers
16k views
Why is the getter called so many times by the rendered attribute?
Related to a previous example, i tried to monitor my get/set methods on the server (when they are called, and how often). So, my actual been look such : @ManagedBean(name="selector") @RequestScoped ...