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.

15879 questions
399
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,786
  • 4
  • 16
  • 12
395
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
  • 15,646
  • 48
  • 123
  • 210
353
votes
12 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
  • 26,344
  • 42
  • 116
  • 201
235
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
  • 31,759
  • 32
  • 127
  • 205
233
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
  • 992,635
  • 352
  • 3,478
  • 3,452
222
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,737
  • 8
  • 33
  • 54
174
votes
10 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
  • 3,955
  • 7
  • 32
  • 40
170
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
  • 8,569
  • 11
  • 44
  • 52
153
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,880
  • 5
  • 29
  • 43
145
votes
5 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,117
  • 13
  • 73
  • 116
136
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
  • 54,015
  • 59
  • 193
  • 252
131
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
  • 332,322
  • 92
  • 617
  • 683
111
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
  • 332,322
  • 92
  • 617
  • 683
105
votes
4 answers

How to use enum values in f:selectItem(s)

I want to make a selectOneMenu dropdown so I can select a status on my question. Is it possible to make the f:selectItem more flexible considering what happens if the order of the enums changes, and if the list was large? And could I do this better?…
LuckyLuke
  • 42,935
  • 77
  • 254
  • 416
105
votes
1 answer

When to use , tag files, composite components and/or custom components?

I started using JSF 2.0 with Facelets recently and got puzzled by new composite components knowing existing and other templating techniques offered by Facelets 1.x. What is the difference between those approaches? Functionally they…
mrembisz
  • 12,274
  • 7
  • 33
  • 32
1
2 3
99 100