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
37
votes
5 answers

java.lang.IllegalStateException:Could not find backup for factory javax.faces.application.ApplicationFactory

I'm using this : Tomcat 7.0 JSF 2.0 JRE 7 but when trying to run my application, I got the following exception: java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory. at…
Benjamin Gimet
  • 707
  • 1
  • 9
  • 16
36
votes
1 answer

Why do I need to nest a component with rendered="#{some}" in another component when I want to ajax-update it?

So I've found a few answers close to this, and I've found enough to fix the problem I had. But even so, I'm curious as to understand the workings around this. Let me illustrate with an example : I have a facelet .xhtml page that looks like this…
blo0p3r
  • 6,790
  • 8
  • 49
  • 68
36
votes
3 answers

JSF 2 - How can I get a context-param value from web.xml using JSF EL?

I would like to declare some constant values used by my JSF 2 webapp inside the web.xml file like so: myconstantkey some string value
Jim Tough
  • 14,843
  • 23
  • 75
  • 96
36
votes
4 answers

What is FacesContext used for?

What is FacesContext used for? And where exactly is it implemented?
meenus
  • 453
  • 1
  • 5
  • 9
36
votes
3 answers

What does the PF function do in Primefaces?

On many places one can find usage of a function PF with Primefaces. For example in this answer From what I have seen so far it seems to be a magic "make it work a little better" function. But I don't believe in this kind of stuff so: What does this…
Jens Schauder
  • 77,657
  • 34
  • 181
  • 348
36
votes
2 answers

Why Facelets is preferred over JSP as the view definition language from JSF 2.0 onwards?

I see that from JSF 2.0 onwards Facelets view definition language is the preferred view definition language and not JSP which has been deprecated as a legacy fallback. I want to understand why Facelets is preferred over JSP as the view definition…
Geek
  • 26,489
  • 43
  • 149
  • 227
35
votes
4 answers

How to conditionally render plain HTML elements like

I'm trying to implement a composite component which either displays the information details of a user in plain text or displays them through editable input texts fields if the desired details are those of the user currently connected. I know that al…
Ionut
  • 2,788
  • 6
  • 29
  • 46
35
votes
7 answers

JQuery Conflicts with Primefaces?

I have included JQuery1.5 in the header of a JSF page. In that page there is a bunch of Primefaces components already coded. After I have included the Jquery.js in the header of the page, some primefaces components like loses their…
Selvin
  • 12,333
  • 17
  • 59
  • 80
35
votes
8 answers

JSF 2.0 File upload

I am looking around a few blogs, to try to find how to upload files using JSF 2.0 But all the solutions kind of confuse me. I would like to know what do I exactly need to be able to successfully upload a file(MP3, PDF, video... what ever type) and…
javing
  • 12,307
  • 35
  • 138
  • 211
35
votes
3 answers

How to use if, else condition in jsf to display image

I have a condition where I have an enrollment form in which if userid is 0 it should show the dummy image and when I edit user from any update, I check for if userid which is not equal to 0 then display the image corresponding to userid. I used JSTL…
pravi
  • 434
  • 1
  • 4
  • 13
35
votes
1 answer

What is the difference between redirect and navigation/forward and when to use what?

What is difference between a navigation in JSF FacesContext context = FacesContext.getCurrentInstance(); context.getApplication().getNavigationHandler().handleNavigation(context, null, url); and a redirect HttpServletResponse response =…
ad-inf
  • 1,520
  • 4
  • 30
  • 53
34
votes
4 answers

How to find indication of a Validation error (required="true") while doing ajax command

I have a form inside a dialog which I close by clicking on commandbutton with ajax , like this
Daniel
  • 36,833
  • 10
  • 119
  • 200
34
votes
5 answers

Email validation using regular expression in JSF 2 / PrimeFaces

I have an input field taking an email address: How can I validate the entered value as a valid email address using regex in JSF 2 / PrimeFaces?
Nidheesh
  • 4,390
  • 29
  • 87
  • 150
34
votes
2 answers

How to inject in @FacesValidator with @EJB, @PersistenceContext, @Inject, @Autowired

How can I inject a dependency like @EJB, @PersistenceContext, @Inject, @AutoWired, etc in a @FacesValidator? In my specific case I need to inject a Spring managed bean via @AutoWired: @FacesValidator("emailExistValidator") public class…
Mahmoud Saleh
  • 33,303
  • 119
  • 337
  • 498
34
votes
1 answer

What is the function of @this exactly?

As far as I know the @this is to denote the current component triggering the event, such as : And in JSF 2 Ajax, the @this can also mean the encapsulating component, like :
Bertie
  • 17,277
  • 45
  • 129
  • 182