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 ...
14 votes
5 answers
73k views
SQLException: No value specified for parameter 1
I encountered the following error when I was executing my application: java.sql.SQLException: No value specified for parameter 1 What does it mean? My UserGroup list in my dao: public List<...
11 votes
6 answers
6k views
Using JPA entities in JSF. Which is the best strategy to prevent LazyInitializationException?
Would like to hear experts on best practice of editing JPA entities from JSF UI. So, a couple of words about the problem. Imagine I have the persisted object MyEntity and I fetch it for editing. In ...
6 votes
2 answers
21k views
What exactly does "Response already committed" mean? How to handle exceptions then?
I know writing business logic in getters and setters is a very bad programming practice, but is there any way to handle exceptions if the response is already committed? What exactly is the meaning ...
16 votes
1 answer
11k views
How and when should I load the model from database for JSF dataTable
I've a data table as below: <h:dataTable value="#{bean.items}" var="item"> I'd like to populate it with a collection from the database obtained from a service method so that it is immediately ...
7 votes
2 answers
9k views
Best practices in JSF: model, actions, getters, navigation, phaselisteners
I have got into a project for re factoring of JSF implementation. The existing code is not followied the proper JSF standards. To achieve that I am learning all the concepts in JSF ( I already have ...
2 votes
2 answers
15k views
Primefaces "sortBy=" doesn't work
I'm developing an application using Primefaces + JSF. My data table works, but has a problem at sort sortBy=, I tried sortBy="#{pc.rota}" but it doesn't work too: Data table show all rows, the ...
8 votes
1 answer
9k views
Can I use multiple managed bean in the same xhtml page? [closed]
when there are data that are repeated in several pages (reference example) Is that I can load into a single managed bean and I use several managed bean in the same page. What is its impact?
5 votes
1 answer
6k views
Between a jsf page and a managed bean, why the getter method is called twice
I have a jsf page with a form has an outputtext in it. The value of outputtext component is called from a backing bean (or managed bean). I know when I code it as #{MyBean.myString} Jsf rename it and ...
4 votes
1 answer
10k views
JSF2 - javax.el.PropertyNotFoundException. Not working with methods
when I try to render the view, browser show this error 01:46:11,371 GRAVE [javax.enterprise.resource.webcontainer.jsf.application] (http--127.0.0.1-8080-1) Error Rendering View[/index.xhtml]: javax....
10 votes
4 answers
8k views
Make multiple dependent / cascading selection components in JSF
I am trying to make 4 dependent / cascading selection components. In this question, the selection component happens to be a <h:selectOneMenu>, but this is of course applicable on any other kind ...
4 votes
4 answers
6k views
PrimeFaces 3.0.M3 Cell Editor does not update value
I have read there, but i can't take edited value from primefaces datatable cellEditor, it gives me unedited value. i am using jpa. xhtml page: <?xml version="1.0" encoding="UTF-8"?> <!...
5 votes
5 answers
3k views
NullPointer with Primefaces GMap OverlaySelect event
I have a problem with Primefaces whose version is 3.0.M3 . I used gmap and prime p:ajax.I wanted to do something is to get clicked Marker when a marker is clicked by a user on Gmap. Here is the Code ...
4 votes
2 answers
24k views
Primefaces datatable pagination not working
I have a application using JSF2.0, Spring3 and Hibernate4. I am displaying values in Primefaces 3.4.2 datatable, the problem is when I click the pagination, datatable rows always remain in first 10 ...
10 votes
1 answer
3k views
Measure the render time of a JSF view after a server request
I would like to measure the rendering time of a JSF application. Because of out of my power reasons, the application can't be populated with logs. Therefore, my question would be, is there any way in ...
2 votes
3 answers
18k views
How to integrate results from RESTful api with JSF?
How to pass results from RESTful service to JSF components? I read many postings, but couldn't find a straightforward method. Using RESTful APIs wherever possible is the main requirement for my ...
4 votes
1 answer
7k views
How to get id of current component in EL
I'm working with JSF and PrimeFaces, but I need to get the value of the id of a component. Because I'm building dinamycally panels with diferent id, to show a the panel I need to compare if is the ...
2 votes
3 answers
9k views
Displaying an error message for an error that happens in a getter, not in an action
Moin! I have a situation where I try to display an error message using p:message for an Exception that is raised in a getter. But this results into the message "WARNUNG: There are some unhandled ...
0 votes
2 answers
11k views
Changes not reflected in JPA entities after updating in h:dataTable
I am working with Eclipse and Glassfish 3.0. Pretty new to this technology although I have done similar things before. Very simple really got a datatable bound to a backing bean. Add methods and ...
1 vote
2 answers
7k views
How does EL #{bean.id} call managed bean method bean.getId()
I do not really understand how getter and setter work althougth it is a basic concept. I have the following code, how is the attribute id sent to Managed Bean? Is it captured by getter method? My ...
7 votes
1 answer
3k views
Why should we make a SessionScoped ManagedBean thread safe in JSF?
I know that Application-Scope persists across multiple users, so it's obvious that we should make sure that all the ApplicationScoped ManagedBeans are thread safe. I also understand that we don't ...