facelets

javax.faces.DEFAULT_SUFFIX not working

依然范特西╮ 提交于 2019-12-20 14:37:36
问题 Ive been reading some posts about javax.faces.default_suffix but without success when trying to implement it. Using : jsf 2.0, jboss 7.1, Mojarra 2.1.5 I need to show in URL the following : localhost:8080/myproject/index.jsf when navigating also need show the xxx.jsf web.xml <welcome-file-list> <welcome-file>/comum/inicio/index.xhtml</welcome-file> </welcome-file-list> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> </servlet

JSF: value bindings inside nested ui:repeat

我是研究僧i 提交于 2019-12-20 10:21:45
问题 I have a strange problem with the <ui:repeat> tag. Even for my very simple example, value bindings inside nested repeat components do not work as expected. I have a simple facelet like so: <h:body> <h:form> <ui:repeat value="#{sandbox.rows}" var="row"> <ui:repeat value="#{row.columns}" var="column"> <h:outputText value="#{column.value}" /> <h:selectBooleanCheckbox value="#{column.value}" /> </ui:repeat> <br/> </ui:repeat> <h:commandButton action="#{sandbox.refresh}" value="Refresh" /> </h

JSF 2.0 Facelets nested templates inheritance

自古美人都是妖i 提交于 2019-12-20 07:44:53
问题 Is it posible to define templates that inherit from other templates in facelets? Something like this /GlobalTemplate.xhtml /users/UsersTemplate.xhtml template="/GlobalTemplate.xhtml" /users/viewUser.xhtml template="/users/UsersTemplate.xhtml" Then viewUsers.xhtml will be called by browser 回答1: Yes, it's definitely possible. 来源: https://stackoverflow.com/questions/5323937/jsf-2-0-facelets-nested-templates-inheritance

ViewScoped works like RequestScoped - why?

梦想的初衷 提交于 2019-12-20 04:55:10
问题 I wrote a ViewScoped Managed-Bean and every time I refresh the page in my webbrowser, the Managed-Bean seems to be recreated, article is null, it loads a new article-object and so on. For me it looks like the same behaviour as RequestScoped. I use Eclipse IDE for Java EE Developers, the newest JDK, Apache Tomcat 7.0.8 and Mojarra 2.0.3. What is wrong? Managed-Bean: ... import javax.annotation.PostConstruct; import javax.faces.application.FacesMessage; import javax.faces.bean.ManagedBean;

ViewScoped works like RequestScoped - why?

筅森魡賤 提交于 2019-12-20 04:55:02
问题 I wrote a ViewScoped Managed-Bean and every time I refresh the page in my webbrowser, the Managed-Bean seems to be recreated, article is null, it loads a new article-object and so on. For me it looks like the same behaviour as RequestScoped. I use Eclipse IDE for Java EE Developers, the newest JDK, Apache Tomcat 7.0.8 and Mojarra 2.0.3. What is wrong? Managed-Bean: ... import javax.annotation.PostConstruct; import javax.faces.application.FacesMessage; import javax.faces.bean.ManagedBean;

NullPointerException in MyFaces facelet inclusion

回眸只為那壹抹淺笑 提交于 2019-12-20 04:27:10
问题 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

JSF Language switcher and ajax update

强颜欢笑 提交于 2019-12-20 02:26:49
问题 This question is a follow - up of the older Language switcher implementation in JSF 2. The substance of the question is still valid, although PrimeFaces has released some newer builds, and my JSF knowledge is a bit better than before. To summarize, I have a single xhtml page, fully ajaxified. The language switcher is this: <h:form id="selectLanguage" > <p:commandLink action="#{languageSwitcher.setLanguage('it')}" rendered="#{languageSwitcher.language!='it'}" > <h:graphicImage library ="images

How do I attach a FacesMessage from the backing bean to a specific field in a ui:repeat?

扶醉桌前 提交于 2019-12-20 01:41:39
问题 I have a form with a variable number of input elements, like this: <ui:repeat var="_lang" value="#{myBean.languages}"> <h:inputTextarea value="${_lang.title}" id="theTitle" /> <h:messages for="theTitle"/> </ui:repeat> When a certain method in the backing bean is triggered, I want to add a message to, say, the second iteration of the ui:repeat , but not the other ones. I've seen different variations of this question around here, and all problems appear to be due to the ui:repeat 's iterations

How do I attach a FacesMessage from the backing bean to a specific field in a ui:repeat?

♀尐吖头ヾ 提交于 2019-12-20 01:41:39
问题 I have a form with a variable number of input elements, like this: <ui:repeat var="_lang" value="#{myBean.languages}"> <h:inputTextarea value="${_lang.title}" id="theTitle" /> <h:messages for="theTitle"/> </ui:repeat> When a certain method in the backing bean is triggered, I want to add a message to, say, the second iteration of the ui:repeat , but not the other ones. I've seen different variations of this question around here, and all problems appear to be due to the ui:repeat 's iterations

What is the difference between Custom Components and Composite Components?

牧云@^-^@ 提交于 2019-12-19 10:35:10
问题 What is the difference between JSF Custom Components and Facelets Composite Components? 回答1: JSF custom components are Java classes which extend UIComponent. Facelets composite components are XHTML files which use http://java.sun.com/jsf/composite namespace. See also: When to use <ui:include>, tag files, composite components and/or custom components? 来源: https://stackoverflow.com/questions/5704620/what-is-the-difference-between-custom-components-and-composite-components