facelets

Warning: This page calls for XML namespace declared with prefix [tagname] but no taglibrary exists for that namespace

二次信任 提交于 2019-11-27 03:15:23
问题 I've declared the Facelet view template as follows: <ui:composition template="./templates/master.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:p="http://primefaces.prime.com.tr/ui"> <ui:define name="content"> <h:panelGroup rendered="#{!current.hasLoggedIn()}"> <h:panelGroup layout="block" styleClass="warningBox"> <h:outputText value="#{app.youHaveNotLoggedIn}"/> <br/> <h:link value="#{lbls.login}" outcome

Conditional variable definition in JSF

对着背影说爱祢 提交于 2019-11-27 02:52:42
问题 i want to change the variable value based on a condition so i tried the following: <h:head> <ui:param name="userCase" value="Insert" /> <ui:fragment rendered="#{employee.employeesBulkInsert==false}"> <ui:param name="userCase" value="Update" /> </ui:fragment> <title>#{userCase} Employee </title> </h:head> but it doesn't work in the update case, it shows an empty string, any ideas why ? i know that there are other solutions like defining the variable in the backing bean, or make the conditional

How to display my application's errors in JSF?

左心房为你撑大大i 提交于 2019-11-27 02:50:56
In my JSF/Facelets app, here's a simplified version of part of my form: <h:form id="myform"> <h:inputSecret value="#{createNewPassword.newPassword1}" id="newPassword1" /> <h:message class="error" for="newPassword1" /> <h:inputSecret value="#{createNewPassword.newPassword2}" id="newPassword2" /> <h:message class="error" for="newPassword2" /> <h:commandButton value="Continue" action="#{createNewPassword.continueButton}" /> </h:form> I'd like to be able to assign an error to a specific h:message tag based on something happening in the continueButton() method. Different errors need to be displayed

JSF 2 facelets <f:metadata/> in template and page

吃可爱长大的小学妹 提交于 2019-11-27 02:48:51
问题 I have the following template (masterLayout.xhtml): <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"> <f:view contentType="text/html"> <ui:insert name="metadata"/> <h:head> <title><ui:insert name="windowTitle"/> | MySite</title> </h:head> <h:body> <div id="container"> <div id="header"> <ui:insert name="header"> <ui:include src="/WEB-INF/templates/header.xhtml"/> </ui:insert> </div> <div id="content">

Skip executing <ui:include> when parent UI component is not rendered

喜欢而已 提交于 2019-11-27 02:22:36
问题 I have the following construct at several places in my webapp in order to conditionally render page fragments depending on some actions: <h:panelGroup rendered="#{managedBean.serviceSelected == 'insurance'}"> <ui:include src="/pages/edocket/include/service1.xhtml" /> </h:panelGroup> I have observed, that the <ui:include> is still executed even when the rendered attribute evaluates false . This unnecessarily creates all backing beans associated with the service1.xhtml file which is been

Changing JSF prefix to suffix mapping forces me to reapply the mapping on CSS background images

半腔热情 提交于 2019-11-27 01:58:52
I've been using prefix mapping for years and decided to switch to suffix mapping, just to get rid of the /faces in the url really. I just wanted to check I'm going in the right direction before I dig myself a hole as there are a few unexpected things going on. I changed from this: <servlet-mapping> <servlet-name>FacesServlet</servlet-name> <url-pattern>/faces/*</url-pattern> </servlet-mapping> to this: <servlet-mapping> <servlet-name>FacesServlet</servlet-name> <url-pattern>*.xhtml</url-pattern> </servlet-mapping> And then I see that everything going through FacesServlet has .xhtml appended to

Opening Facelets page errors with “This XML file does not appear to have any style information associated with it.”

筅森魡賤 提交于 2019-11-27 01:04:20
I'm trying to run my Eclipse JSF project on Apache Tomcat on other computer. I created a WAR file with this tutorial . However, when I deploy the WAR and open the Facelet page in Firefox, I'm getting only the following error message: This XML file does not appear to have any style information associated with it. The document tree is shown below. This my first time when I try run my JSF app without Eclipse. How is this caused and how can I solve it? I'm actually trying to open the following Facelet page: <?xml version="1.0" encoding="UTF-8"?> <ui:composition template="/WEB-INF/templates

How to remove border from specific PrimeFaces p:panelGrid?

牧云@^-^@ 提交于 2019-11-27 00:25:47
问题 I have difficulty in removing border from a specific PrimeFaces <p:panelGrid> . <p:panelGrid styleClass="companyHeaderGrid"> <p:row> <p:column> Some tags </p:column> <p:column> Some tags </p:column> </p:row> </p:panelGrid> I have been able to remove border from the cells with: .companyHeaderGrid td { border: none; } But .companyHeaderGrid { border: none; } Does not work. 回答1: The border is been set on the generated tr and td elements, not on the table . So, this should do: .companyHeaderGrid

How to show user-friendly error page in browser when runtime exception is thrown by servlet?

蹲街弑〆低调 提交于 2019-11-27 00:20:05
I'm developing web-application with JSF. I tested it as I was able to but from time to time runtime exceptions are thrown. So, how to redirect user to special error page every time an exception is thrown (instead of displaying 500 Error with full tomcat logs)? Just declare an <error-page> in web.xml wherein you can specify the page which should be displayed on a certain Throwable (or any of its subclasses) or a HTTP status code . E.g. <error-page> <exception-type>java.lang.Exception</exception-type> <location>/error.jsp</location> </error-page> which will display the error page on any subclass

ui:repeat and h:panelGrid

一世执手 提交于 2019-11-26 23:08:50
问题 When using something like <h:panelGrid columns="1"> <ui:repeat var="o" value="#{mybean.list}"> <h:outputText value="#{o.text}"/> </ui:repeat> </h:panelGrid> with lets say 10 list entries I only get 1 row e.g.: one tr with 1 td whereas when I use c:forEach i get 10 (but c:forEach is in fact evil, it messes up everything with ajax) I use mojarra 1.2 - is this a typical Mojarra bug which does not exist in the MyFaces implementation? Will it disappear in 2.x of the Mojarra releases? 回答1: The