jsf-2

JSF 2.0 - Richfaces ViewExpiredException

倾然丶 夕夏残阳落幕 提交于 2019-12-11 11:27:47
问题 Sometimes, when I interact with some component of richfaces (eg: clicking a a4j:commandbutton) I get an exception of type ViewExpiredException. If I make an interaction during ajax requests (eg: while the screen is loading) the error ALWAYS happens. Ps 1: the server was not restarted Ps 2: I'm using myfaces 2.1.8. Exception: 09:03:49,385 ERROR [br.com.enterprise.enterprisex.faces.common.EnterpriseExceptionHandler] EnterpriseExceptionHandler.handle: javax.faces.application.ViewExpiredException

JSF 2.0 validation controller

独自空忆成欢 提交于 2019-12-11 11:24:20
问题 I am very new to JSF/Java but I wanted to know if anyone knows a good way to create a custom validation controller. I have a lot of forms in my web application with fields that overlap such as First Name, SSN, or email. I wanted to create a Controller that would handle all of these validations and messages. Is this a good idea? I have been looking online on documentation but it looks like every example I have found they put the validation method within a specific bean and not in a controller.

Primefaces cellEditor required inputText

那年仲夏 提交于 2019-12-11 11:18:36
问题 I have a PrimeFaces p:dataTable with one column of type p:cellEditor with an p:inputText field. This inputText is supposed to be required but if I set required="true" and leave the input empty nothing happens / no message is shown. The form including the above is submitted anyway. Here's my code, especially the <p:column headerText="Data Value"> part: <h:form id="my-form"> <p:dataTable var="dataItem" rowIndexVar="rowIndex" value="#{backingBean.dataList}" draggableRows="true" editable="true"

Pass method expression attribute through to nested composite component

試著忘記壹切 提交于 2019-12-11 11:15:00
问题 I have composite component DocumentSelector , which contains another composite component modalWindow . <cc:interface componentType="selector.DocumentSelector"> <cc:attribute name="showSelector" method-signature="void listener(java.util.List)"/> </cc:interface> <cc:implementation> <div id="#{cc.clientId}"> <ccs:modalWindow id="modal_window" showListener="#{cc.showSelector}" mode="ajax"> </ccs:modalWindow> </div> </cc:implementation> I need to pass method #{cc.showSelector} to composite

com.sun.facelets.tag.jsf.core.CoreLibrary must be an instance of org.apache.myfaces.view.facelets.tag.TagLibrary Error

大兔子大兔子 提交于 2019-12-11 11:13:33
问题 I am using Myfaces 2.2.8 and Richfaces 4.5.x jar and tomcat 8. But when launch my url I am getting an error "java.lang.Exception: com.sun.facelets.tag.jsf.core.CoreLibrary must be an instance of org.apache.myfaces.view.facelets.tag.TagLibrary" My web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app

Why does isLocalValueSet() returns true in this case?

ε祈祈猫儿з 提交于 2019-12-11 11:10:08
问题 Consider the snippet: <f:metadata> <f:viewAction onPostback="true" action="#{simpleBean.action}" phase="PROCESS_VALIDATIONS"> </f:viewAction> </f:metadata> <h:head> <title></title> </h:head> <h:body> <h:form> <h:inputText value="#{simpleBean.inputValue}" binding="#{simpleBean.htmlInputText}" validator="nameValidator" /><br/> <h:commandButton value="Submit" action="#{simpleBean.action}" /> </h:form> </h:body> with view action method just printing the bounded component properties. System.out

Replace spaces with nonbreakable spaces in JSF [duplicate]

不羁岁月 提交于 2019-12-11 10:55:41
问题 This question already has an answer here : Component to inject and interpret String with HTML code into JSF page (1 answer) Closed 4 years ago . I need some JSF 2.1.29 advise. I have the following using of the bean's property: #{someBean.someProperty} Where #{someBean.someProperty} returns 7 8 (note the number of spaces between the digits). And in the browser it's displayed as just 7 8 . When I replace those spaces with   , then they are displayed as is: 7      8 How can I get to actually

Understanding JSF components class lifetime

半城伤御伤魂 提交于 2019-12-11 10:53:55
问题 What's the component's lifetime? Traversing the UIInput sources I've noticed that there's local field called value which is essentailly the value of the component. I've also noticed that after processing all convertion and validation we compare a new value with an old value of the component and if they're different fire valueChange event. Actually, here's the piece of code taking over the quing events: if (isValid()) { Object previous = getValue(); setValue(newValue); setSubmittedValue(null);

JSF o:tabbedPane issue changing SelectedIndex

喜欢而已 提交于 2019-12-11 10:48:36
问题 im working with JSF 2.0 and the OpenFaces <o:tabbedPane> im having some troubles changing the tabs.. i have an index with four jsf pages includes. like this <o:tabbedPane loadingMode="client" tabGapWidth="3" id="pestana" tabClass="tab_form" rolloverTabClass="tab_form2" selectedTabClass="tab_form3" tabAlignment="bottomOrRight" style="width:100%;" binding="#{GeneralBean.panelTabs}"> <o:subPanel caption="1" styleClass="pestanas"> <ui:include src="/datosDeLaCotizacion.jsf"/> </o:subPanel> <o

How to flush buffer early in JSF 2.0?

主宰稳场 提交于 2019-12-11 10:44:19
问题 I'm using JSF 2.0 and I want to flush the buffer early (between head and response) as it is one of the best practices to improve performance. In this article BalusC shows how to do in in a JSP page ( <% response.getWriter().flush(); %> ), but I'm using xhtml pages. Does anyone know how to do it? Thanks! Damian 回答1: If you're using <h:head> in JSF2, then you can in theory do this by explicitly flushing the underlying servlet output stream in the encodeEnd() method of the Renderer associated