197
votes
7answers
80k views

What is the difference between JSF, Servlet and JSP?

Is JSP = Servlet? And JSF = Pre-build UI based JSP (like asp.net web control)?
95
votes
3answers
41k views

Differences between action and actionListener

What is the difference between action and actionListener, and when should I use action versus actionListener?
79
votes
8answers
24k views

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 ...
65
votes
2answers
12k views

How to choose the right bean scope?

I noticed that there are different bean scopes like: @RequestScoped @ViewScoped @SessionScoped @ApplicationScoped What is the purpose of each? How do I choose a proper scope for my bean?
64
votes
4answers
36k views

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 ...
62
votes
16answers
28k views

Java EE 6 vs. Spring 3 stack [closed]

I'm starting a new project now. I have to choose technologies. I need something light, so no EJB or Seam. On the other hand I need JPA (Hibernate or alternative) and JSF with IceFaces. Do you think ...
57
votes
6answers
33k views

JSF backing bean structure (best practices)

I hope that in this post, I can get people's opinions on best practices for the interface between JSF pages and backing beans. One thing that I never can settle on is the structure of my backing ...
54
votes
2answers
16k views

ViewParam vs @ManagedProperty(value = “#{param.id}”)

What is the difference between defining View Params like this: <f:metadata> <f:viewParam name="id" value="#{someBean.id}"/> </f:metadata> And defining the property in the ...
52
votes
5answers
50k views

How do you get the length of a list in the JSF expression language?

How would I get the length of an ArrayList using a JSF EL expression? "#{MyBean.somelist.length}" does not work.
45
votes
3answers
57k views

JSF - get managed bean by name

I'm trying to write a custom servlet (for AJAX/JSON) in which I would like to reference my @ManagedBeans by name. I'm hoping to map: http://host/app/myBean/myProperty to: ...
44
votes
3answers
32k views

JSF vs Facelets vs JSP

I can't seem to get a clear answer as to the concrete difference between Java Server Faces vs. so-called facelets. Can anyone give me a clear-as-day answer?!? Also, I understand that either JSF or ...
40
votes
5answers
12k views

Is it possible to use JSF+Facelets with HTML 4/5?

Facelets relies on XML namespaces to work with XHTML. How are HTML 4, and as far as I know, HTML 5 do not support namespaces. Also HTML 5 has some new elements that are not available in XHTML. Even ...
38
votes
4answers
51k views

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 ...
37
votes
2answers
13k views

Why does JSF need to save the state of UI components on the server side?

Until what point in time does JSF save the state of UI components on the server side and when exactly is the UI component's state information removed from the server memory? As a logged-in user on ...
36
votes
2answers
13k views

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 ...

15 30 50 per page