jsf-2.2

Servlet filter with JSF

此生再无相见时 提交于 2019-12-02 08:07:02
问题 I tried to configure Servlet filter with JSF. I get lot of problems here I am using PrimeFaces also. Here is my web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> <display-name>JsfEaxmples</display-name> <context-param> <param-name>javax.faces.STATE_SAVING

Exiting a JSF Flow

二次信任 提交于 2019-12-02 07:51:02
问题 I'm starting to use JSF Flows, and after reading some examples and the specs, I got it to work. I'm using the Packaging Flows in Directories method, as described in section 11.4.3.3 of the specification. It seems easier and more in line with the naming conventions already adopted since JSF 2.0. Bellow is my current directory structure. The flow id is wizard . I understand that there is a concept of exiting the flow by calling a return node . You see, by the image above, that I don't have a

Primefaces downloadFile java.io.IOException: Stream Closed after second time

泪湿孤枕 提交于 2019-12-02 07:19:28
I have issue with primefaces 5.0 component p:fileDownload , I have following bean store DefaultStreamedContent , and I get the value stored to download it simply : Bean : public class EBMail implements Serializable { private DefaultStreamedContent attachment; // @ here setter and getter too . } and from XHTML file : <p:commandLink ajax="false" value="Download Attachment" rendered="#{mbMail.attachment != null}"> <p:fileDownload value="#{mbMail.attachment}" /> </p:commandLink> I get mail attachment file for first time, in 2nd time I get the following exception : WARNING: java.io.IOException:

<f:facet> not working with <h:form>

冷暖自知 提交于 2019-12-02 07:07:03
I have a template, in which a <h:form> is defined. This <h:form> is used all over the application for the CRUD pages of entities. So, at one place I need another enctype for the form, so that I can upload files. I thought I can solve this with a facet in the template: <h:form id="main-form"> <f:facet name="enctype"> <ui:insert name="form-enctype"/> </f:facet> <ui:insert name="buttons"/><p/> <ui:insert name="content"/><p/> <ui:insert name="buttons"/> <ui:insert name="additionalHelper"/> </h:form> And at the concrete page I wanted to set the custom enctype this way: <ui:define name="form-enctype

The earliest moment to visitTree() on fully built Component Tree?

落花浮王杯 提交于 2019-12-02 06:53:57
问题 Good morning, JSF experts! Let me fugure out the problem I'm trying to solve. The application has many forms. And elements in forms can be marked to require authorization of users according to 1) set of rights and their conditional combinations configured for this form element and 2) user rights loaded from db. Solution I'm trying to develop is as follows: I implement custom component, which extends UIComponentBase . In the form's Facelets' markup this custom component would wrap elements

CDI beans injection

烂漫一生 提交于 2019-12-02 05:43:53
Is this a correct approach to inject @ApplicationScoped bean in @SessionScoped bean? will this lead my application scoped bean to be stored in the session of every user? I have an application scoped bean that contains some values we share among all the system users, and now I need to get that values within a method in a session bean. Tarik Injecting a bean of the same or a broader scope in another bean is completely legal and correct either in JSF or CDI beans, like the example you provided. The difference between CDI beans and JSF managed beans regarding that is when you try to inject a bean

#{cc.clientId} evaluated in wrong composite after upgrading to JSF 2.2

≡放荡痞女 提交于 2019-12-02 05:34:45
问题 I have a tag library which was written in JSF 2.0 + PrimeFaces 3.4, now i am trying to update to JSF 2.2 and PrimeFaces 4.0. But i realized that the value of attributes passed to component evaluated in composite component and it leads to wrong id for rendering. enum.xhtml (composite component) <cc:interface> <cc:attribute name="render" default="@this"/> ..... </cc:interface> <cc:implementation> <h:selectOneMenu ......../> <p:ajax update="#{cc.attrs.render}" process="#{cc.attrs.execute}" /> <

Referencing dataTable footer

≡放荡痞女 提交于 2019-12-02 05:16:27
I am trying to use Ajax updates triggered from a component within a p:dataTable to update the footer of the table. But no matter how I write my ID references in the p:ajax tag I don't seem to be able to get them right. This is an example: <h:form id="formId"> <p:dataTable id="tableId" var="row" value="#{testBean.dataRows}" rowIndexVar="rowIx"> <p:column> <h:outputText value="#{row}"/> <p:inputText id="innerInputId" value="#{testBean.str}"> <p:ajax event="keyup" update="tableId:footerId"/> <p:ajax event="keyup" update=":formId:tableId:footerId"/> <p:ajax event="keyup" update="@form:tableId

@FacesComponent on shared library

霸气de小男生 提交于 2019-12-02 04:25:21
I'm trying to use a custom jsf component on Websphere 8.5. The component class is annotated with @FacesComponent. The component is on a shared lib jar on the server. I already have an faces-config inside the jar META-INF folder. If the jar is inside my ear file it works as expected, but when its on a sharedlib it gives me "Undefined component type MyUIActionList" error. Any ideas on how to make this work? Web fragment JARs belong in WAR/WEB-INF/lib and absolutely not in EAR/lib nor Server/lib . See also a.o. chapter 8.1 of Servlet 3.0 specification (emphasis mine): 8.1 Annotations and

NullPointerException in MyFaces facelet inclusion

喜你入骨 提交于 2019-12-02 03:20:50
I'm trying to migrate simple JSF2.2 prototype from Mojarra 2.2.5 (... where works fine ...) to MyFaces 2.2.3 but a NullPointerException occurs. What I normally do using Mojarra is to include (inject) programmatically a JSF page within a container. The sample inclusion page ( inclusion.xhtml ) is: <h:panelGroup id="container"> </h:panelGroup> <h:form> <h:commandButton value="Include page" action="#{inclusion.include('included.xhtml')}" /> </h:form> The included page ( included.xhtml ) contains something like: <h:outputText value="INCLUDED TEXT ..." /> This is the managed bean : @ManagedBean