jsf-2.2

FacesContext#getViewRoot() returns null while setting <f:view locale> for first time

白昼怎懂夜的黑 提交于 2019-12-10 19:33:57
问题 I am trying to change my JSF application locale in one page and that has to change all my pages locale. I have followed this link, and it works well Localization in JSF, how to remember selected locale per session instead of per request/view If I run the application I can change the locale in my index.xhtml and that locale is set per session, so if then I go to page index_1.xhtml I will see the locale changed. My problem is that when I run the application and I write the URL: http://localhost

java.io.NotSerializableException: org.jboss.weld.bean.ManagedBean

杀马特。学长 韩版系。学妹 提交于 2019-12-10 18:06:21
问题 Given the following CDI bean in JSF 2.2.6 running on GlassFish server 4.0. import javax.inject.Named; import javax.faces.view.ViewScoped; import java.io.Serializable; import org.primefaces.model.LazyDataModel; @ViewScoped @Named("myBean") public class MyBean extends LazyDataModel<T> implements Serializable { @Inject //Injecting an EJB. private MyLocalEJB service; private static final long serialVersionUID = 1L; } This causes the following exception to be thrown on undeployment of the

Skip processing of input components inside p:dataTable when a button is pressed which only needs to get selected rows

送分小仙女□ 提交于 2019-12-10 13:39:41
问题 I have prepared just a simple example of shopping basket for the demonstration purpose only. The XHTML page: <p:dataTable id="cartDataTable" value="#{testManagedBean.qtyList}" var="cart" selection="#{testManagedBean.selectedQtyList}" rowKey="#{cart.id}"> <p:column selectionMode="multiple" /> <p:column> <h:outputText value="#{cart.id}"/> </p:column> <p:column> <p:inputText value="#{cart.qty}"/> </p:column> </p:dataTable> <p:commandButton value="Delete" process="@this cartDataTable"

JSF 2.2 interpret empty string submitted values as null not working

佐手、 提交于 2019-12-10 13:27:53
问题 I have migrated from Java EE 6 to Java EE 7, and now with JSF 2.2 the context param INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL seems not work. In JSF 2.1 I set it to "true" and it works perfectly, but now I get always blank strings. <context-param> <param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name> <param-value>true</param-value> </context-param> Can anyone say something about it? 回答1: The same happens with glassfish 4 with the latest Mojarra-2.2.5 as

ViewScoped CDI bean recreated after some AJAX requests

假如想象 提交于 2019-12-10 11:56:21
问题 I have a CDI ViewScoped bean and a JSF page. After a couple of AJAX requests the bean somehow recreated. Here is the full code of the application: index.xhtml <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://xmlns.jcp.org/jsf/facelets"> <h:head> <title>Facelet Title</title> </h:head> <h:body> Hello from Facelets <h:form> <h:inputText value="#{questionBean.newTag}"></h:inputText> <h:commandButton value=

@NotNull Bean Validation ignored for viewParam

余生颓废 提交于 2019-12-10 11:34:28
问题 Problem I'm trying to validate a mandatory GET request parameter. In the view I've added a corresponding viewParam tag. <f:metadata> <f:viewParam name="customerId" value="#{customerDetailBean.customerId}"/> </f:metadata> And my CDI bean looks like this @Model public class CustomerDetailBean { @NotNull private Integer customerId; public Integer getCustomerId() { return customerId; } public void setCustomerId(Integer customerId) { this.customerId = customerId; } } When I use the following

Starting faces flow

旧巷老猫 提交于 2019-12-10 11:27:56
问题 My question for today is: is it possible to start the faces flow without using h:commandButton component? In my particular case I would like to use the h:selectOneMenu component to start the particular flow based on the value selected by the user. 回答1: The answer is yes, but with a bit of tweaking. To enter a flow, it is required to create a navigation outcome that equals the flows id. UICommand components (like h:commandButton and h:commandLink) can do that but UIInput components can not

GF4 incorrect timeout exception thrown in Servlet when multiple large responses are returned (requested)

房东的猫 提交于 2019-12-10 10:27:03
问题 The issue occurs when multiple requests (in this example, for images) are handled by GF. For some reason, the response outputstream blocks (for larger writes) and I get a timeout after a few seconds. I downloaded the latest (2/12/2013) promoted built from glassfish repo and replaced nucleus-grizzly-all.jar but I still get the same issue. Any ideas of what causes this issue and how I can resolve it? Thanks. Exception java.io.IOException: java.util.concurrent.TimeoutException at org.glassfish

Getting ViewExpiredException in clustered environment while state saving method is set to client and user session is valid

大憨熊 提交于 2019-12-10 09:21:27
问题 I have a JSF application that uses Mojarra 2.2.9 and is deployed on WebSphere 8.5.5.4 on clustered environement and javax.faces.STATE_SAVING_METHOD is set to client . Even though all my application beans are request scoped, sometimes when the user session is valid and the user is doing post request on a page he gets ViewExpiredException . What may be causing this issue and how can I solve it? Will changing the javax.faces.STATE_SAVING_METHOD to server solve it? If so, what is the impact of

<f:ajax render> not working via <composite:clientBehavior>

徘徊边缘 提交于 2019-12-10 08:31:28
问题 I have a composite component which has ajax: <composite:interface> <composite:attribute name="question" required="true"/> <composite:attribute name="value" required="false"/> <composite:attribute name="id" required="true" /> <composite:clientBehavior name="alter" event="change" targets="input"/> </composite:interface> <composite:implementation> <label for="#{cc.attrs.id}"> <h:outputText value="#{cc.attrs.question}" /> </label> <div class="fld"> <h:selectOneRadio value="#{cc.attrs.value}" id=