mojarra

JSF SelectItems and escaping (xss)

泪湿孤枕 提交于 2019-12-05 01:36:22
there is a selectOneMenu in my example with a f:selectItems-attribute. The select-items are resolved from my bean like this: <h:selectOneMenu value="#{bean.value}"> <f:selectItems value="#{bean.selectItems}" var="obj" itemValue="#{obj}" itemLabel="#{obj.name}"/> </h:selectOneMenu> The method getSelectItems() in my bean looks like that: public List<MyObject> getSelectItems() { List<MyObject> list = new LinkedList<MyObject>(); MyObject obj = new MyObject("Peter"); list.add(obj); return list; } The objects that are displayed are simple objects with a attribute "name". Nothing special up to this

f:convertNumber on Double: ClassCastException

廉价感情. 提交于 2019-12-04 20:39:05
In JSF 2.3, I have an h:inputText to edit a Double value, which has in addition Bean-Validation constraints. The h:inputText has a f:convertNumber . When submitting the form, this leads to a ClassCastException (see below). So, it seems, that f:convertNumber produces a Long which then, could not be converted to Double to validate the @DecimalMin constraint, right? In JSF 2.2 this worked as expected, the problem occured after upgrading to JSF 2.3. Does anybody has any ideas what could be the problem? I could reproduce this in WildFly 15.0.1 with the following minimal example with just one

Primefaces <p:ajax update=“@all” /> doesn't work

醉酒当歌 提交于 2019-12-04 18:11:14
I've got a problem with using p:ajax update atribute element. When I use in my code <p:ajax update="@all" /> then I am getting javax.el.PropertyNotFoundException . When I use <f:ajax render="@all" /> I don't get any. I though that thouse tags are nearly same. Can anyone explain whats happening? I am using mojjara implementation, primefaces 3.5 and Liferay jsf portlet bridge. Example of stacktrace: Caused by: javax.el.PropertyNotFoundException: /pages/views/personForm.xhtml @95,99 value="#{personManagementBean.item.contact.phoneNumber}": Target Unreachable, 'null' returned null at com.sun.faces

ViewExpiredException after upgrade to jsf2

拥有回忆 提交于 2019-12-04 08:13:44
We recently upgraded a major platform from jsf 1.2 to 2.0. After upgrading we're getting several ViewExpiredException errors each hour. From reading up on the topic it seems that this is an expected exception when sessions expire, however we've reviewed the access logs and we are getting these exceptions even when requests are only 5 minutes apart in some cases. My questions are as follows: 1) Other than session expiration, what other conditions might cause ViewExpiredException? 2) The exception we're logging doesn't contain much detail about the exact condition that is causing the exception

Problem with h:form and p:ajax (Mojarra 2.0.2 and Primefaces 2.0.2)

大兔子大兔子 提交于 2019-12-04 05:27:33
问题 I have got this site: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.prime.com.tr/ui"> <h:head></h:head> <h:body> <h:form id="form-some"> <h:inputText id="copingFilePhaseFocus"> <p:ajax event="focus" actionListener="#

When does JSF creates a session & what does it puts in a session map?

删除回忆录丶 提交于 2019-12-04 05:02:00
问题 I am running Mojarra 2.2.0. <context-param> <param-name>javax.faces.STATE_SAVING_METHOD</param-name> <param-value>client</param-value> </context-param> The managed bean action method is- public void action() { HttpSession session = (HttpSession) FacesContext.getCurrentInstance() .getExternalContext().getSession(false); System.out.println(session.getId()); // not null for stateful views } For stateless views session.getId() throws NPE For views which are not stateless- Firing a GET request,

Cannot create a session after the response has been committed

雨燕双飞 提交于 2019-12-03 19:11:27
问题 Opening the JSF page gives me the following exception: Caused by: java.lang.IllegalStateException: Cannot create a session after the response has been committed Here is the JSF code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces

JSF 2.2 - fileupload does not work with Ajax. Form appears to have incorrect enctype (only via AJAX)

对着背影说爱祢 提交于 2019-12-03 13:26:57
Trying to implement the JSF 2.2 example I have the following code: <h:form prependId="false" enctype="multipart/form-data"> <!-- Now it's the AJAX file upload component --> <h:inputFile id="fileUpload" value="#{someBean.file}" > <f:ajax /> </h:inputFile> <h:commandButton value="Upload" /> </h:form> According to some JSF 2.2 this should work but in my case it is giving me the following error: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is application/x-www-form-urlencoded;charset=UTF-8 Looking into the request although I have set my form

Is this Primefaces bug or Mojarra/MyFaces bug

梦想与她 提交于 2019-12-02 16:43:09
问题 I cannot seems to be able to fire an event when I am within column of dataTable . Here is my simple demostration <h:form id="form"> <!--This section of p:tree here seems to be the reason causing the event not fired when click the command button--> <p:tree value="#{viewBean.root}" var="node" dynamic="true" cache="false" selectionMode="checkbox" selection="#{treeBean.selectedNode}"> <p:ajax event="expand" update=":form:messages" listener="#{viewBean.onNodeExpand}" /> <p:ajax event="collapse"

How can I prevent the jQuery UI look'n'feel from disappearing after form submits/postbacks?

心已入冬 提交于 2019-12-02 09:02:55
问题 I have a JSF (Mojarra) v2.1.11, Primefaces v3.4.2, Java 6 web application using jQuery datepicker. I am using a selector that looks similar to this: $('#form1\\:dp').datepicker({showOn: 'button', buttonText: "Choose"}); This enables the user to click the button in order to invoke the datepicker. The issue I'm having is that the "button" disappears after the user submits the form. Apparently, the "button" loads only once when the page is initially loaded. I'd like to know how (what the best