jsf-2

ManagedBeanCreationException: cannot set property for managed bean with ManagedProperty

微笑、不失礼 提交于 2019-12-11 21:10:06
问题 i get this error : "com.sun.faces.mgbean.ManagedBeanCreationException: No se puede definir la propiedad procesos para el bean administrado procesos" when i run my web app. Roughly translated "cannot define property procesos for the managed property procesos" this is my managed bean with the issue: @ManagedBean(name = "procesos") @ViewScoped public class ProcesosBean implements Serializable { @ManagedProperty(value="#{user}") private List<VistaProcesosEntity> procesos; private LoginBean

How to get name of the selected checkbox value from id?

与世无争的帅哥 提交于 2019-12-11 20:48:33
问题 I have rendered checkboxes and I have rendered selected checkboxes values like below: <h:selectManyCheckbox id="chkedition" value="#{adcreateBean.selectedEditions}" layout="lineDirection" styleClass="nostyle"> <f:selectItems value="#{adcreateBean.editions}" var="item" itemLabel="#{item.editionName}" itemValue="#{item.editionID}"/> <p:ajax update="dt1" /> </h:selectManyCheckbox> <h:dataTable id="dt1" value="#{adcreateBean.selectedEditions}" var="it" styleClass="nostyle" width="100%"> <f:facet

Changing request to view scope results in java.io.NotSerializableException: javax.faces.model.ListDataModel

浪子不回头ぞ 提交于 2019-12-11 20:22:10
问题 I get the below error, when setting the scope for the managedBean as ViewScoped. Below is the exception Im getting when trying to invoke the page javax.faces.FacesException: java.io.NotSerializableException: javax.faces.model.ListDataModel at com.sun.faces.renderkit.ResponseStateManagerImpl.getViewState(ResponseStateManagerImpl.java:137) at javax.faces.application.StateManager.getViewState(StateManager.java:555) at com.sun.faces.context.PartialViewContextImpl.renderState

Auto-instantiate session-scoped bean from view-scoped bean

℡╲_俬逩灬. 提交于 2019-12-11 20:14:33
问题 Every time I try to inject a session-scoped bean into my view-scoped beans, I get a NullPointerException when calling said bean. This problem is directly related to auto -instantiate a session bean? Here is what I tried so far: faces-config.xml <managed-bean> <managed-bean-name>sessionBean</managed-bean-name> <managed-bean-class>com.example.SessionBean</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> </managed-bean> <managed-bean> <managed-bean-name>viewBean</managed-bean

JSF/Primefaces - Ajax request sometimes skips JSF phases

假装没事ソ 提交于 2019-12-11 20:13:55
问题 Been at this problem for a while and I am kind of stuck. Using: JSF 2.0, Primefaces 3.5, Weblogic Server 10.35, IE 9 Problem: Sometimes ajax request are not processed correctly and you need to click multiple times to get the desired outcome. When I debug JSF phases I can see that after phase 1, restore view, the render response phase is executed skipping update model and the invoke application phase. I have striped my application to the bare minimum and the problem still occurs. xhtml: <h

Session scoped managed bean not available in servlet when using another browser than IE

二次信任 提交于 2019-12-11 20:10:17
问题 I have been using the following bit of code in a servlet to locate a session backing bean (as suggested by BalusC) without problems until recently. Now it only works on Internet Explorer. Chrome and Firefox appear to be getting a totally new backing bean rather than the original backing bean. When calling functions in the backing bean, it falls over with null pointer errors for objects in the backing bean that were definitely initialized in the original. FacesContext facesContext = FacesUtil

java.lang.ClassCastException: javax.faces.component.StateHolderSaver cannot be cast to [Ljava.lang.Object;

旧巷老猫 提交于 2019-12-11 19:27:46
问题 I am displaying a list of items with links in my xhtml page. When I click my "back to previous page" button from that link, I basically reset the flags in my bean to indicate to the xhtml which page to display, and reload the list of links from my database. When I click the same link (or any other link for that matter) in this new page, I get this error: javax.portlet.faces.BridgeException: javax.portlet.faces.BridgeException: javax.faces.FacesException: Unexpected error restoring state for

Primefaces: Dialog with inputTextarea not updating controller's variable

社会主义新天地 提交于 2019-12-11 19:27:12
问题 I have this Dialog: <p:dialog header="Ingrese Comentario" widgetVar="dlg1" appendTo="@(body)" modal="true" position="top" hideEffect="fold" showEffect="fold" closable="true" draggable="true" > <h:form id="d_ingresarComentario"> <h:panelGrid columns="2"> <p:inputTextarea value="#{tareaController.comentarioNuevo.comentario}" rows="7" cols="60" placeholder="Ingrese su comentario aquí" counter="display1" maxlength="200" counterTemplate="{0} Caracteres faltantes." > </p:inputTextarea> <br/> <h

Provide a wildcard f:selectItem value in p:selectOneMenu with dynamic data and Converter

痞子三分冷 提交于 2019-12-11 19:22:16
问题 I have a <p:selectOneMenu> component, that is fed with an Array of instances of some Class (say ClassABC). In the top of the selectItems list, I want to provide a <f:selectItem> that will serve as a Wildcard/Any option, and it's value should be a null object. I managed to make this work as <p:selectOneMenu value="#{someBean.selectedInstance}" converter="classABCDConverter" > <!-- Wildcard Value --> <f:selectItem itemLabel=" * Any * " itemValue="" /> <!-- Dynamic Data with Real Instances -->

How to use PrimeFaces 3.2 in Eclipse Indigo SR2?

ε祈祈猫儿з 提交于 2019-12-11 19:15:00
问题 I'm trying to use PrimeFaces 3.2. I'm using Eclipse Indigo SR2. I'm creating a JSP page using PrimeFaces tags. The standard <h:commandButton> is working, but <p:commandButton> is not working. <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%> <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4