facelets

Access raw expression of ValueExpression attribute to taglib component

泪湿孤枕 提交于 2020-01-02 06:56:11
问题 Can I access the expression string of a ValueExpression passed as attribute value to my taglib component? My goal is to programmatically derive missing attribute values from it. In this case I'm trying to avoid having to repeat an attribute as a literal. now: <a:columnText title="name" value="#{entity.name}" sortBy="entity.name" /> desired: <a:columnText title="name" value="#{entity.name}" /> -taglib.xml <tag> <tag-name>columnText</tag-name> <source>column-text.xhtml</source> <attribute>

Duplicate component ID in JSF using composite component twice in view

最后都变了- 提交于 2020-01-02 05:11:49
问题 I "inherited" a JSF 2 (JSF 2.2.7) application in my company and facing a java.lang.IllegalStateException because two component seem to have the same ID. The structure of the view is as follows (I extracted the relevant code for illustration purpose, it may contain some typos/invalid syntax as I changed some names): <p:commandButton id="editButton" action="#{controller.prepareItem()}" update=":itemEditDlg" oncomplete="PF('itemtEditDlg').show()" /> <comp:editItemDlg id="itemEditDlg" /> <p

Invisible comments in jsf 2.0? [duplicate]

和自甴很熟 提交于 2020-01-02 00:12:09
问题 This question already has an answer here : How can I remove HTML comments in my Facelets? (1 answer) Closed 5 years ago . is it possible to embed comments in my .xhtml-files that are only displayed in the source and not the rendered result? I want to include author, date,... in the files but they should not be visible to the enduser in the generated output. If I use the standard comment-tags <!-- --> the browser displays them. 回答1: Add the following into your web.xml : <context-param> <param

Facebook social plugins and JSF

半城伤御伤魂 提交于 2020-01-01 20:04:43
问题 I have to integrate the Facebook social plugins into a JSF application. This recommends that I add the fbml namespace to the xhtml file that it's rendered in the response. I have in my XHTML file: <!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:ui="http://java.sun.com/jsf/facelets" ... xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://ogp.me/ns#"> But the fb

Facebook social plugins and JSF

ぐ巨炮叔叔 提交于 2020-01-01 20:01:01
问题 I have to integrate the Facebook social plugins into a JSF application. This recommends that I add the fbml namespace to the xhtml file that it's rendered in the response. I have in my XHTML file: <!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:ui="http://java.sun.com/jsf/facelets" ... xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://ogp.me/ns#"> But the fb

Proper way to call servlet from Facelets?

徘徊边缘 提交于 2020-01-01 11:48:31
问题 What is the proper way to call a servlet from a facelets file using a form with submit button? Is there a particular form required? 回答1: Just use a plain HTML <form> instead of a JSF <h:form> . The JSF <h:form> sends by default a POST request to the URL of the current view ID and invokes by default the FacesServlet . It does not allow you to change the form action URL or method. A plain HTML <form> allows you to specify a different URL and, if necessary, also the method. The following kickoff

Proper way to call servlet from Facelets?

余生颓废 提交于 2020-01-01 11:48:21
问题 What is the proper way to call a servlet from a facelets file using a form with submit button? Is there a particular form required? 回答1: Just use a plain HTML <form> instead of a JSF <h:form> . The JSF <h:form> sends by default a POST request to the URL of the current view ID and invokes by default the FacesServlet . It does not allow you to change the form action URL or method. A plain HTML <form> allows you to specify a different URL and, if necessary, also the method. The following kickoff

Class org.springframework.web.jsf.el.SpringBeanFacesELResolver must extend the type javax.el.ELResolver

∥☆過路亽.° 提交于 2020-01-01 08:35:14
问题 I am trying to integrate Spring into a JSF application. In faces-config.xml , I have included this: <application> <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver> <view-handler>com.sun.facelets.FaceletViewHandler</view-handler> </application> but it shows a weird warning which I can't get rid of: Class org.springframework.web.jsf.el.SpringBeanFacesELResolver must extend the type javax.el.ELResolver Any ideas? 回答1: From the spring documentation, you will see

Xhtml pages and HttpSession test , no jstl?

一世执手 提交于 2020-01-01 07:16:12
问题 I have a dynamic web application in Java EE with JSF, Facelets, Richfaces. My pages are all xhtml pages. So JSTL isn't working in it. For my account pages and all other private pages to be reachable, I want to test if the user got connected, so if the attribute session in HttpSession is not null. If it's null, the user gets redirected in the welcome page. I tried in my xhtml page : <jstl:if test="${sessionScope['session']==null}"> <jstl redirect...> </jstl:if>--> but as it's not jsp page it

How to reference value declared in cc:attribute in cc:implementation

蓝咒 提交于 2019-12-31 04:30:09
问题 I have a simple JSF 2.0 composite component example. <!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:cc="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"> <head> <title> A panel box component </title> </head> <body> <cc:interface> <cc:attribute name="model" required