facelets

Which jars do I need in order to avoid “NoClassDefFoundError: com/sun/facelets/tag/jsf/ComponentHandler”?

余生颓废 提交于 2019-12-24 13:26:01
问题 I'm trying to build a JavaServer Faces 2.0 project (using Apache Myfaces 2.0.2 + Tomcat 7.0.25 via Eclipse Indigo). All seems to be set, Tomcat starts ok, but when I try to open a web page I get the error: SEVERE: An exception occurred javax.faces.FacesException: java.lang.NoClassDefFoundError: com/sun/facelets/tag/jsf/ComponentHandler As I understand, some jar(s) are missing, the one which has this class: com.sun.facelets.tag.jsf.ComponentHandler. Jar finder tells me that I should have "jsf

How to force only one page to open with SSL?

本小妞迷上赌 提交于 2019-12-24 12:29:24
问题 In my project, I am using SSL but it works for all pages.I want to use it for only a login page, after that page it should revert to HTTP protocol. How can i do that? I found a way below, but it does not work. <security-constraint> <web-resource-collection> <web-resource-name>Notify page, accessed internally by application</web-resource-name> <url-pattern>/Login.xhtml</url-pattern> </web-resource-collection> <user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user

Optional field with minimum length validation in JSF

一笑奈何 提交于 2019-12-24 10:57:31
问题 I have a registration form with an optional field but if you enter any value it should be more than 2 characters. How to skip validation if the user leaves the field blank? <h:inputText id ="fooid" maxlength="50" tabindex="4" value="#{registrationBean.foo}" validatorMessage="Please enter two or more characters"> <f:validateRegex pattern="^[A-Za-z-_./\s]{2,50}$"/> <f:ajax event="blur" render="fooPanel" /> </h:inputText> Any help would be appreciated. 回答1: It works as intented if you add the

ui:fragment rendered attribute not working after upgrading Facelets to JSF 2

守給你的承諾、 提交于 2019-12-24 09:58:54
问题 I am upgrading a project from JSF1.2/Facelets1.1 to JSF2.1 with built in facelets. The following no longer works and I don't know why. Both ui:fragments apparently evaluate to true, and both the link version and the plain text version are rendered: <ui:fragment rendered="#{rootcauseid ne rc.id}"> <a href="#{request.contextPath}/viewrootcause.jsf?rootcausenum=#{rc.id}">Root Cause #{rcRowCounter + 1}</a> </ui:fragment> <ui:fragment rendered="#{rootcauseid eq rc.id}"> <h:outputText value="Root

Change Update attribute dynamicaly in Primefaces

ε祈祈猫儿з 提交于 2019-12-24 09:39:57
问题 I am looking for a way to change the update attribute of a primefaces command button from the backing bean after the form submit. What i am trying to achieve is to update the component id's based on the results from backing bean method. For example, i am trying to update the form and the growl message with a command button, now if some error has happened from the backing bean(not validation error), i need to update only the growl message and the form shouldn't be updated. <p:commandButton

Updating text component via selectOneMenu from inside a JSF2/Facelets subview

北战南征 提交于 2019-12-24 07:54:21
问题 I have a Facelets subview called basedata-cpanel.xhtml , which gets its parameters passed via <ui:param> s: <ui:define name="content-top"> <h:form> <ui:include src="/subviews/basedata-cpanel.xhtml"> <ui:param name="customerId" value="#{pqHome.pq.customer.id}" /> <ui:param name="customerName" value="#{pqHome.pq.customer.name}" /> <ui:param name="customers" value="#{organizationManager.allCustomers}" /> <ui:include /> </h:form> </ui:define> In the subview, I simply want a panel below to show

JSF 2: Facelets composition (template) not rendered for error-page

老子叫甜甜 提交于 2019-12-24 07:38:50
问题 I'm using JSF 2.0 with Facelets in a Java EE 6 application server (GlassFish v3). I have configured an error page for exceptions, in web.xml: <error-page> <exception-type>java.lang.Throwable</exception-type> <location>/error-all.xhtml</location> </error-page> This is the /error-all.xhtml test page: <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http:

Using Facelets instead of JSP results in java.lang.StackOverflowError at javax.servlet.http.HttpServletRequestWrapper.getSession()

邮差的信 提交于 2019-12-24 02:43:19
问题 I am using JBoss4.2 with the eclipse IDE. When I run the hellojsf program using JSP view technology, it works fine. When I try with Facelets usings the same components, I am getting the below exception: 2012-06-20 12:41:30,941 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/HelloJSF].[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception java.lang.StackOverflowError at javax.servlet.http.HttpServletRequestWrapper.getSession

Iterate <f:verbatim> within <ui:repeat>

﹥>﹥吖頭↗ 提交于 2019-12-24 02:31:10
问题 I have a @ViewScoped bean with a List<String> containing plain HTML. I want to iterate over this list and output plain html: <c:forEach items="#{bean.list}" var="html"> <f:verbatim>#{html}</f:verbatim> </c:forEach> That snippet above works well but when the page is refreshed the bean costrunctor is recalled. This issue/bug is known: JSTL c:forEach causes @ViewScoped bean to invoke @PostConstruct on every request So the suggestion is to replace <c:forEach> with <ui:repeat> . <ui:repeat value="

Iterate <f:verbatim> within <ui:repeat>

余生长醉 提交于 2019-12-24 02:31:08
问题 I have a @ViewScoped bean with a List<String> containing plain HTML. I want to iterate over this list and output plain html: <c:forEach items="#{bean.list}" var="html"> <f:verbatim>#{html}</f:verbatim> </c:forEach> That snippet above works well but when the page is refreshed the bean costrunctor is recalled. This issue/bug is known: JSTL c:forEach causes @ViewScoped bean to invoke @PostConstruct on every request So the suggestion is to replace <c:forEach> with <ui:repeat> . <ui:repeat value="