facelets

What&#39;s the difference between <h:head> and <head> in Java Facelets?

。_饼干妹妹 提交于 2019-11-26 14:36:52
问题 See this. When and why to use <h:head> , instead of <head> ? I've seen Primefaces won't work with <head> , though. 回答1: The <head> tag is a HTML tag, which defines the head of the HTML page (this is where you define metadata, or include the resources such as JavaScript or CSS for example). The <h:head> is a JSF tag (introduced with JSF 2.0) that handles the <head> part of your page. The interest of having such JSF tag is that this head becomes part of your JSF components tree, and thus, you

JSF/Facelets: why is it not a good idea to mix JSF/Facelets with HTML tags?

老子叫甜甜 提交于 2019-11-26 14:28:41
问题 I've read this several times now: some developers aren't advocates of interleaving JSF/Facelets tags with HTML tags in their XHTML files. Obviously the HTML tags won't be part of the UI component tree, but what's the disadvantage of that? I often find code examples where the authors do that kind of mixing: http://www.ibm.com/developerworks/java/library/j-facelets/ http://www.packtpub.com/article/facelets-components-in-jsf-1.2 http://oreilly.com/catalog/9780596529246 "Seam in Action" also

Custom Facelet component in JSF

微笑、不失礼 提交于 2019-11-26 14:17:59
问题 Is it possible to create a custom JSF core Facelet component. Something like <custom:composition> of <ui:composition> , or <custom:include> for <ui:include> It would be helpful if someone can tell me the steps involved. Thanks in advance, Kaushal 回答1: It are in essence taghandlers. I.e. classes extending from TagHandler. Here's a Hello World taghandler. com.example.HelloTagHandler public class HelloTagHandler extends TagHandler { public HelloTagHandler(TagConfig config) { super(config); }

Reset input fields without executing validation

穿精又带淫゛_ 提交于 2019-11-26 14:16:52
问题 I have a Facelets view as below: <h:form id="f1"> <p:panelGrid id="p1" columns="2"> <p: inputText value="Distance Travelled::/><p:inputText value="#{airTransportUsage.distance}" immediate="true" required="true" requiredMessage="Distance Travelled Field cannot be left blank.." converterMessage="Distance Travelled must be a number" validatorMessage="Distance Travelled must be a valid number.." id="dis"> <f:validateLongRange minimum="1"/> </p:inputText> <p:commandButton value="Reset" action="#

Programmatically create and add composite component in backing bean

佐手、 提交于 2019-11-26 14:05:57
问题 I am working with a dynamic dashboard where users can pin and remove items as they like. Now I have a problem that I want to add existing composite component to the view from the backing bean. I've tried to find correct way to do this from the internet but no success so far. Here is the simple composite component I want to add: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html

Can not find the tag library descriptor for http://java.sun.com/jsf/facelets

孤人 提交于 2019-11-26 13:53:27
问题 I've a JSP with <%@taglib uri="http://java.sun.com/jsf/facelets" prefix="ui" %> However it errors with The absolute uri: http://java.sun.com/jsf/facelets cannot be resolved in either web.xml or the jar files deployed with this application I have libraries facelets-lib.jar and jsf-facelets-1.1.10.jar , which I suppose is Facelets, but they do not contain JSP taglib descriptors. What file is correct? 回答1: Facelets is intented to replace JSP altogether. But yet you're attempting to declare it as

What is the difference between creating JSF pages with .jsp or .xhtml or .jsf extension

痴心易碎 提交于 2019-11-26 12:57:25
I saw some examples creating the JSF pages with .jsp extension, other examples creating them with .xhtml extension, and other examples choose .jsf . I just would like to know what the difference is between above extensions when working with JSF pages, and how to choose the appropriate extension? BalusC JSP is an old view technology and widely used in combination with JSF 1.x. Facelets (by some people overgeneralized as XHTML ) is the successor of JSP and introduced as default view technology of JSF 2.x at end of 2009. When you were seeing JSPs, you were perhaps reading outdated books,

JSF facelets template packaging

China☆狼群 提交于 2019-11-26 12:38:54
问题 As always, i\'m a little confused. Here https://community.jboss.org/wiki/ModularWebAppsWithJSF2 i\'ve learned that it is easy and works out of the box to bundle templates in separate jars since JSF 2.0. The only problem is: i can\'t get it working. I simply deploy a \"page.xhtml\" in all flavors (META-INF directory, resources directory, root; with and without faces-config.xml) in a jar that is included in the web application WEB-INF/lib and request something like http://host/demo/faces/page

How to display my application&#39;s errors in JSF?

喜夏-厌秋 提交于 2019-11-26 12:36:33
问题 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

JavaServer Faces 2.2 and HTML5 support, why is XHTML still being used

爱⌒轻易说出口 提交于 2019-11-26 12:26:21
Having read about HTML5 support in JSF 2.2 , I was surprised to find the same XHTML doctype as in previous Facelets versions in the template file created with a new web application in Netbeans. The only difference is that the HTML tag reads in JSF 2.2: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html"> , rather than as follows in older JSF versions: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"> It seems a bit wrong to keep using XHTML with the promise of HTML5 in mind. I only have the option to use 2.2 if I choose it from