I\'m new to JSF and in the process of learning im building an online book store application.
I have 1 class and 1 bean: Book.java
and BookCatelog
JSF2 offers two iterating components out the box: So, you can just have your managed bean like follows: And you can use (note that the And here's how to use a As to the JSTL to the response and requires a
s. Both components can take among others a List
as value.
@ManagedBean
@RequestScoped
public class BookCatalog implements Serializable {
private List
to generate for example an
:
var
attribute basically exposes the currently iterated item by exactly the given name in the EL scope within the component)
instead:
, that's also quite possible, but you should keep in mind that JSTL tags have a different lifecycle than JSF components. Long story short: JSTL in JSF2 Facelets... makes sense?See also: