Questions tagged [jsf]

JSF, Jakarta Server Faces (formerly known as JavaServer Faces) is a model-view-presenter framework typically used to create HTML form based web applications. Using the standard components and render kit, stateful HTML views can be defined using Facelets or JSP tags and wired to model data and application logic via backing beans.

Filter by
Sorted by
Tagged with
862votes
16answers
444kviews

What is the difference between JSF, Servlet and JSP?

I have some questions. These are : How are JSP and Servlet related to each other? Is JSP some kind of Servlet? How are JSP and JSF related to each other? Is JSF some kind of Pre-Build UI based JSP ...
user avatar
  • 14.8k
404votes
4answers
277kviews

Differences between action and actionListener

What is the difference between action and actionListener, and when should I use action versus actionListener?
user avatar
  • 4,856
402votes
2answers
225kviews

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?
user avatar
359votes
12answers
221kviews

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

Sometimes, when using <h:commandLink>, <h:commandButton> or <f:ajax>, the action, actionListener or listener method associated with the tag are simply not being invoked. Or, the bean ...
user avatar
265votes
9answers
102kviews

Why JSF calls getters multiple times

Let's say I specify an outputText component like this: <h:outputText value="#{ManagedBean.someProperty}"/> If I print a log message when the getter for someProperty is called and load the page,...
user avatar
  • 4,095
238votes
1answer
129kviews

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

The JSF <h:outputStylesheet>, <h:outputScript> and <h:graphicImage> components have a library attribute. What is this and how should this be used? There are a lot of examples on the ...
user avatar
  • 1.0m
235votes
13answers
77kviews

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 ...
228votes
2answers
281kviews

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.
user avatar
  • 3,827
214votes
4answers
279kviews

Understanding PrimeFaces process/update and JSF f:ajax execute/render attributes

What exactly are process and update in PrimeFaces p:commandXxx components and execute and render in f:ajax tag? Which works at the time of validation? What does update attribute do rather than ...
user avatar
  • 3,240
178votes
10answers
279kviews

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 ...
user avatar
  • 4,015
173votes
3answers
94kviews

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: <c:if test="${lpc.verbose}"> ... </c:if> However, I'm not sure if ...
user avatar
  • 8,899
157votes
4answers
148kviews

Performing user authentication in Java EE / JSF using j_security_check

I'm wondering what the current approach is regarding user authentication for a web application making use of JSF 2.0 (and if any components do exist) and Java EE 6 core mechanisms (login/check ...
user avatar
  • 7,383
156votes
2answers
137kviews

What can <f:metadata>, <f:viewParam> and <f:viewAction> be used for?

Can anyone clarify how we can use in general, or a in real world example, this snippet? <f:metadata> <f:viewParam id="id" value="#{bean.id}" /> <f:viewAction action="#{bean....
user avatar
  • 2,920
156votes
8answers
59kviews

Handling a colon in an element ID in a CSS selector [duplicate]

JSF is setting the ID of an input field to search_form:expression. I need to specify some styling on that element, but that colon looks like the beginning of a pseudo-element to the browser so it gets ...
user avatar
  • 59.3k
151votes
5answers
172kviews

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 <p:tab> of a <p:tabView> residing in a <p:layoutUnit> of a <p:layout>. Here is the ...
user avatar
  • 15.6k

15 30 50 per page
1
2 3 4 5
2373