facelets

<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

FileNotFoundException when using Facelets tagfile

南楼画角 提交于 2019-12-02 06:53:39
问题 I'm trying to run the example ch05 from the "Core JavaServer Faces" Book (http://horstmann.com/corejsf/) After logging in I get the following message: /sections/planetarium/sidebarLeft.xhtml @12,72 <corejsf:planet> null planet is a composition, residing under WEB-INF/tags/corejsf/planet.xhtml The corejsf.taglib.xml is: <?xml version="1.0"?> <!DOCTYPE facelet-taglib PUBLIC "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN" "http://java.sun.com/dtd/facelet-taglib_1_0.dtd"> <facelet-taglib>

java.lang.ClassNotFoundException: org.springframework.faces.security.FaceletsAuthorizeTagHandler

為{幸葍}努か 提交于 2019-12-02 06:52:42
问题 I trying to add Spring Security Facelets Tag Library as it is written here. I added in web.xml: <context-param> <param-name>javax.faces.FACELETS_LIBRARIES</param-name> <param-value>/WEB-INF/springsecurity.taglib.xml</param-value> </context-param> I added in springsecurity.taglib.xml: <?xml version="1.0"?> <!DOCTYPE facelet-taglib PUBLIC "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN" "http://java.sun.com/dtd/facelet-taglib_1_0.dtd"> <facelet-taglib> <namespace>http://www

Image not getting updated

橙三吉。 提交于 2019-12-02 06:52:08
The image property is not getting updated. I am using this.user.setImage(a) to set the value but its not working.My managed bean is request scoped. 1)Here is my bean.The problem is in the handleFileUpload function. package com.bean; import javax.faces.context.FacesContext; import javax.faces.event.PhaseId; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.Persistence; import javax.servlet.http.HttpSession; import org.primefaces.event.FileUploadEvent; import org.primefaces.model.UploadedFile; import com.entity.User; public class

Extract XML namespace declarations into separate tagfile/taglib

余生长醉 提交于 2019-12-02 06:31:03
问题 I would like to seperate my XML namespace declarations at the top of the page into a seperate (tag)file in which I can include in any Facelets page I wish. Is this possible? Or do I need to copypaste all XML namespaces in each Facelets file? Here's a theoretical example, xmlns.xhtml : <something xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jsp/jstl

FileNotFoundException when using Facelets tagfile

白昼怎懂夜的黑 提交于 2019-12-02 06:06:17
I'm trying to run the example ch05 from the "Core JavaServer Faces" Book ( http://horstmann.com/corejsf/ ) After logging in I get the following message: /sections/planetarium/sidebarLeft.xhtml @12,72 <corejsf:planet> null planet is a composition, residing under WEB-INF/tags/corejsf/planet.xhtml The corejsf.taglib.xml is: <?xml version="1.0"?> <!DOCTYPE facelet-taglib PUBLIC "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN" "http://java.sun.com/dtd/facelet-taglib_1_0.dtd"> <facelet-taglib> <namespace>http://corejsf.com/facelets</namespace> <tag> <tag-name>planet</tag-name> <source>tags

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

Using managed-property with CommandButton in Java Server Faces

混江龙づ霸主 提交于 2019-12-02 03:47:43
In addition to my question "Creating an “Edit my Item”-page in Java Server Faces with Facelets" I would liek to cover an issue that this provided. When I press the commandButton the ID=100 is removed and the page is refreshed, and this is Before it even runs the method, right, so this means that I do not have the ID when i press the button. How do you solve this? By having this Managed Bean public class BeanWithId implements Serializable { private String id; private String info; private void populateInfo() { info = "Some info from data source for id=" + id; } public String getId() { return id;

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

Cell edit in primefaces is not updating the value

家住魔仙堡 提交于 2019-12-02 03:15:20
I have a datatable in my primefaces application . The code for the frontend has <!-- Start of customer datatable --> <p:dataTable var="customer" value="#{customerBean.customers}" paginator="true" selection="#{customerBean.selectedCustomer}" selectionMode="single" onRowSelectUpdate=":custList" onRowSelectComplete="custTab.show()" id="custList" widgetVar="custList" update=":custList"> <f:facet name="header"> List of Customers <p:outputPanel> <p:commandButton value="+" type="button" onclick="addCustDlg.show()"/> </p:outputPanel> </f:facet> <p:column sortBy="#{customer.id}" filterBy="#{customer.id