facelets

Pass Argument to a composite-component action attribute

点点圈 提交于 2019-12-17 08:53:36
问题 The title really says it all. I have made an attempt which failed with the error: Illegal attempt to pass arguments to a composite component lookup expression (i.e. cc.attrs.[identifier]). My attempt looks like this: <composite:interface> <composite:attribute name="removeFieldAction" method-signature="void action(java.lang.String)" /> </composite:interface> <composite:implementation> <h:commandButton value="Remove" action="#{cc.attrs.removeFieldAction('SomeString')}"/> </composite

Why does @PostConstruct callback fire every time even though bean is @ViewScoped? JSF

匆匆过客 提交于 2019-12-17 07:14:25
问题 I am using datatable on page and using binding attribute to bind it to my backing bean. This is my code :- <?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 xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.prime.com.tr/ui"> <h:head> <title>Facelet Title</title> </h:head> <h:body> <h:form prependId="false"> <h:dataTable var=

Error Parsing /page.xhtml: Error Traced[line: 42] The entity “nbsp” was referenced, but not declared

久未见 提交于 2019-12-17 07:13:09
问题 I'd like to use non breaking spaces in my JSF page. I know, in plain HTML I could use   for this and this works fine. However, when I put those   in a Facelets page, then it errors as follows: Error Parsing /page.xhtml: Error Traced[line: 42] The entity "nbsp" was referenced, but not declared. How is this caused and how can I solve it? 回答1: Facelets is a XML based view technology. XML has only five predefined entities. The   is not among them. It works only when used in plain HTML or in

How to insert special characters like & and < into JSF components' value attribute?

爷,独闯天下 提交于 2019-12-17 06:36:24
问题 How to insert special characters like & and < into JSF components value attribute ? For example: I want something like this: <h:outputText value="Tom & Jerry Show" /> When I try this, I get the following exception: javax.faces.view.facelets.FaceletException: Error Parsing /foo.xhtml: Error Traced[line: 15] The entity name must immediately follow the '&' in the entity reference. And in case of < , I get the following exception: javax.faces.view.facelets.FaceletException: Error Parsing /foo

@Inject to pass params to a CDI @Named bean via URL

廉价感情. 提交于 2019-12-17 06:14:41
问题 If I cannot use the @ManagedProperty annotation with @Named, because @ManagedProperty doesn't work in CDI(?), then how do you pass params in the URL to the facelets client? In my code, I want to pass javax.mail.getMessageNumber() to details.xhtml through the "back" and "forward" buttons. I understand that @Inject should be used, but what is being injected and how, please? From the glassfish logs, id is always 0, which is quite odd. Even when "forward" is clicked, id never gets above 1 no

Avoiding duplicate ids when reusing facelets compositions in the same naming container

最后都变了- 提交于 2019-12-17 04:02:14
问题 I have a <ui:composition> that contains a few elements with explicit ids and some ajax events which reference these ids for partial processing/updating. I encapsulated this fragment of xhtml inside the composition simply so I could use it in a few different places without having to duplicate the code. However, when I use the composition (with <ui:include> ) more than once inside a page, I get duplicate id exceptions. It seems JSF is not wrapping each composition inside its own naming

Eclipse autocomplete (content assist) with facelets (jsf) and xhtml

狂风中的少年 提交于 2019-12-17 03:31:10
问题 How to activate eclipse (3.5, WTP) content assist in .xhtml pages for JSF (1.2) tags, using facelets? It works in .jsp files, but not xhtml. I google a lot, and in many places (including MyFaces wiki) it is said - "Eclipse can't work with xhtml and facelets" Since this works with .jsp files, I assume there might be some mechanism with which to activate that content assist. I started working on a project, which has already a large codebase, so changing the extensions is not an option.

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

半世苍凉 提交于 2019-12-17 02:31:54
问题 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

JSF returns blank/unparsed page with plain/raw XHTML/XML/EL source instead of rendered HTML output

一曲冷凌霜 提交于 2019-12-16 18:15:35
问题 I have some Facelets files like below. WebContent |-- index.xhtml |-- register.xhtml |-- templates | |--userForm.xhtml | `--banner.xhtml : Both pages are using templates from /templates directory. My /index.xhtml opens fine in browser. I get the generated HTML output. I have a link in /index.xhtml file to /register.xhtml file. However, my /register.xhtml is not getting parsed and returns as plain XHTML / raw XML instead of its generated HTML output. All EL expressions in form of #{...} are

Incompatible magic value 1010792557 when trying to run applet embedded in Facelets

青春壹個敷衍的年華 提交于 2019-12-13 20:06:06
问题 I get this error when I access the Facelets page where the applet is embedded, through Glassfish server. Though when I open it simply from my computer it works fine, so the applet is ok. Is it possible to run applets on Glassfish (3.1, JSF 2.0)? Here's how I try: <applet code="test.TestApplet" archive="TestApplet.jar"/> 回答1: That's a typical message of a ClassFormatError. The magic value of a valid Java class is 0xCAFEBABE , which is the first 4 bytes. But you're getting 0x3C3F786D which