jsf-2

How to evaluate MethodExpressions in JSF composite components

点点圈 提交于 2019-12-22 08:55:04
问题 I am not sure about the "correct" way to deal with method expressions in composite components. My composite uses a backing class with action methods. Theses perform some default actions or delegate to an action method passed by the composite user as an attribute: In using page: <my:component action="#{myBean.actionMethod}" /> Composite: <cc:interface componentType="mycomponentType"> <cc:attribute name="action" method-signature="java.lang.String action()" required="false" /> </cc:interface>

includeViewParams=true doesn't work in templated pages

走远了吗. 提交于 2019-12-22 08:54:42
问题 Consider this template: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets"> <f:view contentType="text/html"> <ui:insert name="metadata"/> <h:head> <title></title> </h:head> <h:body> <ui:insert name="content"/> </h:body> </f:view> </html> this page that uses it (/pages/test.xhtml): <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"

includeViewParams=true doesn't work in templated pages

跟風遠走 提交于 2019-12-22 08:54:17
问题 Consider this template: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets"> <f:view contentType="text/html"> <ui:insert name="metadata"/> <h:head> <title></title> </h:head> <h:body> <ui:insert name="content"/> </h:body> </f:view> </html> this page that uses it (/pages/test.xhtml): <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"

UI formatting messed up on IE when using IP address instead of localhost

本秂侑毒 提交于 2019-12-22 07:50:10
问题 I have an application developed using Primefaces 2.2.1 and JSF 2.0, deployed on Glassfish 3.1 local machine. Problem is that when I access the application using http://localhost:8080/MyApp , the UI formatting is fine. But if I access the application using http://ip-address:8080/MyApp instead of localhost in the url, the UI formatting is kind of messed up. This problem occurs only on IE (I have version 8.0), not on FF. What's the difference between using localhost:8080 and ip-address:8080 in

EJB 3.1 Singleton + JPA + JSF design advice needed

做~自己de王妃 提交于 2019-12-22 06:58:44
问题 Given: simple JSF webapp (no Seam), having JSF beans calling few EJB's which in turn load and persist JPA entities. What I want to is to use @Singleton annotation for ejb's and inject EntityManager instead of EntityManagerFactory : @Singleton public class MyEJB { @PersistenceContext(unitName = PERSISTENCE_UNIT_NAME) protected EntityManager em; // not EntityManagerFactory } Spec says that @Singleton is thread-safe, supports concurrency and transaction attributes which (from my pov) makes it

Enabling UTF-8 character set in JSF2.0, Hibernate, MySQL

大憨熊 提交于 2019-12-22 05:48:29
问题 We are to enable UTF-8 character encoding to our web application designed using JSF2.0, Hibernate, MySQL. Following is the datasource defined in our application context file <bean id="DataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass" value="com.mysql.jdbc.Driver" /> <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/dbname" /> <property name="maxPoolSize" value="10" /> <property name="maxStatements" value="0" />

Enabling and disabling components via select checkbox

妖精的绣舞 提交于 2019-12-22 05:16:25
问题 I have component and I'm trying disable panelGrid below. <h:selectBooleanCheckbox id="checkboxId" value="#{bean.checked}"> <p:ajax update="panelId" event="click"/> </h:selectBooleanCheckbox> <h:panelGrid id="panelId" rendered="#{!bean.checked}"> <h:outputLabel>some text</h:outputLabel> <h:outputLabel>#registrationBB.registrationModel.homeAddress.actualAddressMathWithRegistration}</h:outputLabel> </h:panelGrid> As a result the clicking on checkbox doesn't take no effect. The check indicator

jsf html tag inside value

雨燕双飞 提交于 2019-12-22 04:31:41
问题 I've this commandButton, and I need to add a icon using Bootstrap 3. <h:commandButton id="logoutButton" action="#{loginController.logout()}" class="btn btn-primary" style="margin-top: 10px;margin-left: 10px;" value="Log Out"></h:commandButton> the icon is in a span tag for bootstrap 3 reasons, so I've tried to add it to the value property in the command button like this: <h:commandButton id="logoutButton" action="#{loginController.logout()}" class="btn btn-primary" style="margin-top: 10px

JSF difference between action, actionlistener, onClick [duplicate]

孤街浪徒 提交于 2019-12-22 04:22:13
问题 This question already has answers here : Differences between action and actionListener (4 answers) How to invoke a bean action method using a link? The onclick does not work (3 answers) Closed 2 years ago . I am using JSF in my project. I am using a context menu from PrimeFaces. I see in p:menuItem we have action , actionListener , onclick methods. So my question is: When do I have to use action , actionListner , onclick and what is the order of execution? 回答1: onclick will be executed first.

What is the difference between <f:viewParam> and <f:param>?

℡╲_俬逩灬. 提交于 2019-12-22 04:19:07
问题 What is the difference between <f:viewParam> and <f:param> in JSF 2.1? 回答1: Simply put: <f:viewParam> is used inside <f:metadata> to attach an UIViewParameter as metadata for the current view. For example, if you access the page myapp/check.jsf?id=3 and your check.jsf page has this: <f:metadata> <f:viewParam name="id" value="#{mrBean.id}"/> </f:metadata> The value 3 will be set on mrBean 's id property when the page is loaded. On the other hand, <f:param> sets a parameter in the parent