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

Error parsing XHTML: The content of elements must consist of well-formed character data or markup

As an extension of this question, I'm trying to insert Javascript to a 's onclick property as action is already rendering an ajax table. What I want to do: Get the selected items in a list box and turn them into parameters to be…
luciaengel
  • 667
  • 1
  • 8
  • 10
49
votes
5 answers

Localization in JSF, how to remember selected locale per session instead of per request/view

faces-config.xml: ru ua In a bean action method, I'm changing the locale in the current…
sergionni
  • 13,290
  • 42
  • 132
  • 189
49
votes
5 answers

f:convertDateTime displays wrong Date

In my Web Application I retrieve data using Hibernate and display it in a RichFaces dataTable. In my MySQL-table there is a field of type "date". When I print this field to the log in my Bean, it shows the correct date from database (e.g.…
Tom
  • 586
  • 1
  • 4
  • 9
48
votes
2 answers

What is STATE_SAVING_METHOD parameter in JSF 2.0

I am not able to understand what is the function of this line in web.xml javax.faces.STATE_SAVING_METHOD server I have read that the NetBeans default is…
Basit
  • 8,426
  • 46
  • 116
  • 196
48
votes
1 answer

How to handle session expiration and ViewExpiredException in JSF 2?

Consider the following scenario. I am clicking the submit button of a JSF form, after the session has timed out(expired). The browser displays some exception message: ViewExpiredException: view context could not be restored What I want to do is,…
Selvin
  • 12,333
  • 17
  • 59
  • 80
48
votes
7 answers

Difference between Mojarra and MyFaces

I am starting on JSF2.0 I used a tutorial as a reference but I have the following question: The tutorial used 2 libs only: jsf-api.jar, jsf-impl.jar (but also had JSTL) from Mojarra Project. I tried to dowload them also but seems the site is not…
Cratylus
  • 52,998
  • 69
  • 209
  • 339
48
votes
3 answers

How to display a line break with outputText?

I need to render a line break using outputText so that I can utilize the rendered attributed. I tried but it generated exception The value of attribute "value" associated with an element type "null"…
Thang Pham
  • 38,125
  • 75
  • 201
  • 285
47
votes
5 answers

Adding causes java.lang.IllegalStateException: Cannot create a session after the response has been committed

I'm facing the following exception in a very simple JSF 2 page after adding : java.lang.IllegalStateException: Cannot create a session after the response has been committed at…
Pier Luigi
  • 7,871
  • 9
  • 36
  • 46
46
votes
6 answers

Session timeout and ViewExpiredException handling on JSF/PrimeFaces ajax request

I find this article to be useful for non-ajax request How to handle session expiration and ViewExpiredException in JSF 2? but I can't make use of this when I am submitting using an AJAX call. Suppose in a primefaces dialog, I am making a post…
Mark Estrada
  • 9,013
  • 37
  • 119
  • 186
45
votes
4 answers

Display Current Date on JSF Page

Is it possible to display the current date (today's) in JSF without using a backing bean? I have the following code snippet , but it didn't work out.
Today's date #{currentDate}
or
Namita
  • 779
  • 4
  • 12
  • 24
45
votes
4 answers

Load images from outside of webapps / webcontext / deploy folder using or tag

I need to display images which reside outside of deploy folder in web application using JSF tag or HTML tag. How can I achieve that?
45
votes
1 answer

How do PrimeFaces Selectors as in update="@(.myClass)" work?

I don't understand how PrimeFaces selectors (PFS) work. I can use it. And I think it's a fantastic tool although it doesn't function always for…
John N
  • 844
  • 4
  • 12
  • 20
43
votes
4 answers

How to select JSF components using jQuery?

I am trying to implement jQuery with PrimeFaces and JSF components, but it's not working properly. When I tried to do the same with HTML tags it;s working properly. Here is the code with HTML tags which works properly with jQuery:
Karthikeyan
  • 757
  • 3
  • 11
  • 25
43
votes
3 answers

Conversion Error setting value for 'null Converter' - Why do I need a Converter in JSF?

I have problems understanding how to use selection in JSF 2 with POJO/entity effectively. For example, I'm trying to select a Warehouse entity via the below dropdown:
Bertie
  • 17,277
  • 45
  • 129
  • 182
42
votes
2 answers

Defer loading and parsing of PrimeFaces JavaScript files

While analyzing the performance of a JSF 2.1 + PrimeFaces 4.0 webapp with Google PageSpeed, it recommends among others to defer parsing of JavaScript files. On a test page with a and a form with and which…
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555