Questions tagged [jsf-2]

JavaServer Faces (JSF) is a model-view-presenter framework typically used to create web applications. Version 2.x is a major step ahead compared to JSF 1.x, significantly expanding the standard set of components and component libraries.

JavaServer Faces 2.x is a major step ahead as compared to JSF 1.x, significantly expanding the standard set of components and component libraries. Facelets (which was designed specifically for JavaServer Faces) was adopted as the official view technology for JSF 2.x. This eliminates the life-cycle conflicts that existed with JSP, forcing workarounds by Java developers. Lot of things which are hardly possible in JSF 1.x can be done more elegantly in JSF 2.x.

For the real wiki, please jump over to the wiki: https://stackoverflow.com/tags/jsf/info.

15731 questions
411
votes
4 answers

Differences between action and actionListener

What is the difference between action and actionListener, and when should I use action versus actionListener?
Murat Güzel
  • 4,986
  • 4
  • 19
  • 12
408
votes
2 answers

How to choose the right bean scope?

I noticed that there are different bean scopes like: @RequestScoped @ViewScoped @FlowScoped @SessionScoped @ApplicationScoped What is the purpose of each? How do I choose a proper scope for my bean?
Valter Silva
  • 16,446
  • 52
  • 137
  • 218
367
votes
13 answers

commandButton/commandLink/ajax action/listener method not invoked or input value not set/updated

Sometimes, when using , or , the action, actionListener or listener method associated with the tag are simply not being invoked. Or, the bean properties are not updated with submitted UIInput values. What are…
Muhammad Hewedy
  • 29,102
  • 44
  • 127
  • 219
239
votes
1 answer

What is the JSF resource library for and how should it be used?

The JSF , and components have a library attribute. What is this and how should this be used? There are a lot of examples on the web which use it as follows with the common content/file type css,…
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
236
votes
13 answers

What are the main disadvantages of Java Server Faces 2.0?

Yesterday I saw a presentation on Java Server Faces 2.0 which looked truly impressive, even though I am currently a happy ASP.NET MVC / jQuery developer. What I liked most about JSF was the huge amount of AJAX-Enabled UI components which seem to…
Adrian Grigore
  • 33,034
  • 36
  • 130
  • 210
235
votes
2 answers

How to include another XHTML in XHTML using JSF 2.0 Facelets?

What is the most correct way to include another XHTML page in an XHTML page? I have been trying different ways, none of them are working.
Ikthiander
  • 3,917
  • 8
  • 37
  • 54
184
votes
11 answers

javax.faces.application.ViewExpiredException: View could not be restored

I have written simple application with container-managed security. The problem is when I log in and open another page on which I logout, then I come back to first page and I click on any link etc or refresh page I get this exception. I guess it's…
l245c4l
  • 4,135
  • 9
  • 35
  • 40
176
votes
3 answers

JSTL in JSF2 Facelets... makes sense?

I would like to output a bit of Facelets code conditionally. For that purpose, the JSTL tags seem to work fine: ... However, I'm not sure if this is a best practice? Is there another way to achieve my goal?
Jan
  • 9,397
  • 13
  • 47
  • 52
157
votes
2 answers

What can , and be used for?

Can anyone clarify how we can use in general, or a in real world example, this snippet?
Hanynowsky
  • 2,970
  • 5
  • 32
  • 43
156
votes
6 answers

How to find out client ID of component for ajax update/render? Cannot find component with expression "foo" referenced from "bar"

The following code is inspired from PrimeFaces DataGrid + DataTable Tutorials and put into a of a residing in a of a . Here is the inner part of the code (starting from p:tab component); the outer part is…
perissf
  • 15,979
  • 14
  • 80
  • 117
141
votes
5 answers

Migrating from JSF 1.2 to JSF 2.0

I am working with a rather large app written in JSF 1.2. JSF 1.2 is around 6 years old now. I need to upgrade to JSF 2.0. How painful will this be? I noticed that some attributes in custom tags have been changed etc.
mkoryak
  • 57,086
  • 61
  • 201
  • 257
135
votes
2 answers

When should I use h:outputLink instead of h:commandLink?

When should I use an instead of an ? I understand that a commandLink generates an HTTP post; I'm guessing that outputLink will generate HTTP gets. That said, most of the JSF tutorial material I've read uses commandLink…
Matt Ball
  • 354,903
  • 100
  • 647
  • 710
116
votes
5 answers

Backing beans (@ManagedBean) or CDI Beans (@Named)?

I've just started reading through Core JavaServer Faces, 3rd Ed. and they say this (emphasis mine): It is a historical accident that there are two separate mechanisms, CDI beans and JSF managed beans, for beans that can be used in JSF pages. We…
Matt Ball
  • 354,903
  • 100
  • 647
  • 710
112
votes
11 answers

How to use PrimeFaces p:fileUpload? Listener method is never invoked or UploadedFile is null / throws an error / not usable

I'm trying to upload a file using PrimeFaces, but the fileUploadListener method isn't being invoked after the upload finishes. Here is the view:
Rodrigo Cavalcante
  • 1,577
  • 4
  • 14
  • 21
112
votes
5 answers

Can I update a JSF component from a JSF backing bean method?

Is there a way to have a JSF Backing bean cause an update of a component on the page? I am not looking to use an ajax component with update attribute to update a component on the page. I need to trigger an update from within a JSF backing bean…
BestPractices
  • 12,738
  • 29
  • 96
  • 140
1
2 3
99 100