facelets

how to see docs for jsf/facelets elements in eclipse

十年热恋 提交于 2019-11-27 19:32:24
问题 I am using helios 3.6.2. I have an .xhtml opened with Web Page Editor <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/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" > <f:view> <h:head> ... </h:head> when ever I hover over an element,e.g. f:view, I only see : Element : f:view rather than the description

Exclude css & image resources in web.xml Security Constraint

狂风中的少年 提交于 2019-11-27 19:23:38
问题 I am using JSF2.1 and Glassfish 3.1.2. I specify a security constraint to block everything: <security-constraint> <web-resource-collection> <web-resource-name>Secured Content</web-resource-name> <!-- Block all --> <url-pattern>/*</url-pattern> </web-resource-collection> <!-- only users with at least one of these roles are allowed to access the secured content --> <auth-constraint> <role-name>ADMINISTRATOR</role-name> </auth-constraint> </security-constraint> and have another to allow access a

Pass parameters to messages from resource bundle to components other than **h:outputFormat**

只谈情不闲聊 提交于 2019-11-27 18:04:31
问题 Is there a convenient way to pass parameters to messages from resource bundle to components other than h:outputFormat ? For instance, this is legal: <h:outputFormat value="#{myBundle['parametricMessage']}"> <f:param value="#{myBundle['someParameterValue']}"/> </h:outputFormat> But I need it for a button, like this (which won't work): <h:commandButton value="#{myBundle['parametricMessage']}"> <f:param value="#{myBundle['someParameterValue']}"/> </h:commandButton> Of course, I can use link

<!--[if IE]> conditional comments are rendered HTML-escaped in Facelets

落爺英雄遲暮 提交于 2019-11-27 16:20:33
I'm trying to use an IE conditional comment to declare a CSS resource: <h:outputStylesheet name="common.css" library="css" /> <!--[if IE]> <link rel="stylesheet" type="text/css" href="#{resource['css:ie.css']}" /> <![endif]--> However, that doesn't seem to work. I'm seeing this in my generated HTML output: <link type="text/css" rel="stylesheet" href="/context/faces/javax.faces.resource/common.css?ln=css" /> <!--[if IE]> <link rel="stylesheet" type="text/css" href="/context/faces/javax.faces.resource/ie.css?ln=css"/> <![endif]--> It works fine without the conditional comment. I'm not using the

Facelets and JSTL (Converting a Date to a String for use in a field)

落爺英雄遲暮 提交于 2019-11-27 15:47:20
I need to convert a Date to a String within a page (I dont want to add loads of toStrings to my domain model so adding to the bean is not an option). <ice:graphicImage value="bean.image" title="#{bean.date}"/> The above code works but formats the Date in the default format...I would like to change the format. I have tried using JSTL fmt but this doesnt seem to be compatible with Facelets JSF Convert dates for title attribute . Is there a workaround for this (doesnt have to use JSTL)? Thanks. Indeed, you cannot use the "good old" JSTL in Facelets anymore the way as you would do in JSP. Facelets

Does it matter whether place f:event inside f:metadata or not?

被刻印的时光 ゝ 提交于 2019-11-27 15:08:51
w.r.t. How to execute action on GET request with f:viewParam? <f:metadata> <f:viewParam name="id" value="#{tInputBean.id}" /> <f:event type="preRenderView" listener="#{tInputBean.init}" /> </f:metadata> I'm interested to know whether it matters if a preRenderView f:event is placed inside the f:metadata or not. I've checked the Java EE6 tutorial, Java Server Faces 2.0 Complete Reference, and Core JSF2, and none of them have examples of f:event inside f:metadata, but I've seen lots of examples online like this. JSF2 Compl.Ref says p.540 The f:metadata tag encapsulates the set of elements used to

JSF tags not rendered [duplicate]

我只是一个虾纸丫 提交于 2019-11-27 14:31:42
This question already has an answer here: JSF returns blank/unparsed page with plain/raw XHTML/XML/EL source instead of rendered HTML output 1 answer I am new to JSF, but my JSF tags are not rendered in xhtml file, i tried out every possible solution, but problem is not solved my web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"

Using new xmlns.jcp.org namespace on composites causes java.lang.NullPointerException at java.util.concurrent.ConcurrentHashMap.putIfAbsent

送分小仙女□ 提交于 2019-11-27 14:31:29
I am reading The Java EE 7 Tutorial from http://docs.oracle.com/javaee/7/tutorial/doc/jsf-facelets005.htm#GIQZR After I typed the example code in the chapter 8.5 Composite Components in my IDE and run the example on GlassFish4.0, I got an error java.lang.NullPointerException at java.util.concurrent.ConcurrentHashMap.putIfAbsent(ConcurrentHashMap.java:1078) at com.sun.faces.util.Cache.get(Cache.java:116) at com.sun.faces.application.view.FaceletViewHandlingStrategy.getComponentMetadata(FaceletViewHandlingStrategy.java:237) at com.sun.faces.application.ApplicationImpl.createComponent

Is Facelets page generated to Servlet as JSP generated to Servlet

喜你入骨 提交于 2019-11-27 14:30:21
As all JSPs are generated / translated to Servlets before their execution, is its true for Facelets too? I am working with JSF 2.0 and Facelets and wanted to see its generated Java Code which might be Servlet. BalusC No, Facelets files are parsed to a XML tree using a SAX parser . The XML tree is stored in the Facelet cache . The XML tree is during view build time turned into an UIComponent tree which is accessible by FacesContext#getViewRoot() (which you can traverse by getChildren() during runtime). The component tree normally generates HTML code by their own encodeXxx() methods or the ones

Retrieve the fragment (hash) from a URL and inject the values into the bean

ⅰ亾dé卋堺 提交于 2019-11-27 13:50:25
问题 I am looking for a way to inject values from the fragment (#) of a URL into bean(JSF), in the same way query-parameter values are injected. I am using Ben Alman's Bookmarkable jQuery plugin (http://benalman.com/projects/jquery-bbq-plugin/) to create the URL fragments. I was hoping that Custom regex patterns from prettyFaces could be a way to solve my problem but until now I have been unsuccessful. (http://ocpsoft.com/docs/prettyfaces/snapshot/en-US/html_single/#config.pathparams.regext) I