facelets

POST parameters using wrong encoding in JSF 1.2

此生再无相见时 提交于 2019-12-01 05:50:43
问题 I'm having a problem with charset encoding in my web application (JSF 1.2, Spring and Tomcat 7), and I've ran out of ideas of what to test to see where it is going wrong. Whenever I submit something like 'çã' I get 'çã': that means my data POSTed as UTF-8 is being converted to ISO-8859-1 somewhere in the JSF life cycle. I know that the wrong conversion is UTF-8 to ISO-8859-1 cause it's the same output for: System.out.println(new String("çã".getBytes("UTF-8"), "ISO-8859-1")); I believe that

EL conditional Method Expression

梦想与她 提交于 2019-12-01 05:47:47
问题 I would like to declare a conditional method expression in EL like below: <p:dataTable id="#{cc.attrs.datatableId}" var="overview" rowSelectListener="#{cc.attrs.detailsMode == 'single' ? cc.attrs.bean.onRowSelect : cc.attrs.bean.onRowUrlSelect}"> However, it throws an EL exception: javax.el.ELException: Not a Valid Method Expression: #{ cc.attrs.detailsMode == 'single' ? cc.attrs.bean.onRowSelect : cc.attrs.bean.onRowUrlSelect} How I can declare a conditional EL method expression? 回答1:

ui:repeat doesn't work with f:selectItem

戏子无情 提交于 2019-12-01 03:49:57
问题 i am using icefaces select on menu to select a user from list of users and i want to repeat the selectItem for each user here's what i tried: <ice:selectOneMenu id="users"> <ui:repeat value="#{user.getUserList()}" var="user"> <f:selectItem itemLabel="#{user.name}" itemValue="#{user.id}"/> </ui:repeat> </ice:selectOneMenu> UserBean: @Component("user") @Scope("view") Public class UserBean{ Public List<User> getUserList() throws Exception { return userService.getAllUsers(); } } NOTE: UserBean

Setting ui:param conditionally

岁酱吖の 提交于 2019-12-01 03:32:18
I want to set a ui:param depending on a bean value and I thought using c:if was a good idea. So I put in my page the following code: <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:wai="http://www.id.ethz.ch/wai/jsf" template="/view/listView.xhtml"> <c:if test="#{subscriptionListController.model.listViewName eq 'mySubscriptions'}"> <ui:param name="title" value="#{msg.subscriptionTitleMySubscriptions}"/> </c:if> <c:if

Ecplise autocomplete primefaces tags [duplicate]

旧城冷巷雨未停 提交于 2019-12-01 03:25:06
This question already has an answer here: EL proposals / autocomplete / code assist in Facelets with Eclipse 1 answer I am using Eclipse to work with PrimeFaces like this: <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.prime.com.tr/ui" template="/template/ui.xhtml"> I saw Bozho question and answer . So it works for me only for h and f tags and not for p (primefaces) tag! How can it autocomplete primefaces tag? I've blogged about Helios

Why is BackingBean method called multiple times when requesting facelet?

拜拜、爱过 提交于 2019-12-01 03:12:49
问题 I'm working and learning about JSF + Facelets these days. I have a BackingBean and a Facelet xHTML page. When I request the facelet-page (only one time) the backing-bean-method is called multiple times. What could be the reason for this? I can't see anything special. Thanks in advance. Here is the facelet: <?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

JSF view getting rebuild on each ajax request

寵の児 提交于 2019-12-01 03:07:51
I'm having a performance problem with my JSF/RichFaces/Facelets ajax requests and from what I can tell its because the entire component tree is being rebuild on each ajax request. This is happening even if I use ajaxSingle=true, wrap sections in a4j:region, declare a single section for rerendering or none at all. Our page is a dynamic page with many nested levels. The page may contain around 800-900 fields (inputText, rich calendars, selectOneMenus, etc). The initial load time is an issue, but I understand that issue, its a lot of fields. Once we have that initial build/render time though we

JSF/Facelets : CSS file is not being recognized using <h:outputStylesheet> tag

蹲街弑〆低调 提交于 2019-12-01 02:53:26
I'm working on a project using JSF/Facelets. I want to do some CSS changes on my View XHTML, but nothing happen when i deploy my web application in my Tomcat Server. I've tried many tricks but i've got the same result. Anyway, here's my "styles.css" : body { width: 750px; } #header { width: 100%; font-size: 36px; font-weight: bold; line-height: 48px; background-color: navy; color: white; } #footer { width: 100%; font-weight: bold; background-color: navy; color: white; } And this is the main template "Template.html" including "Header.html" and "Footer.html", where i put my "styles.css" using

JSF 2.0 and Primefaces with Facelets

旧时模样 提交于 2019-12-01 01:54:24
I'm trying to incorporate primefaces into my JSF 2.0 web project. I've recently updated from facelets 1.x to 2.0 and Added primefaces jar to my library folder. Everything is fine except, the way I have my templates structured has a conflict with the primefaces. my template.xhtml looks like this: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com

facelets: passing bean name with ui:param to action attribute

偶尔善良 提交于 2019-12-01 01:20:36
Due to some custom components which expect a bean name (NOT the bean instance) in their attributes I need to pass the actual bean name between pages. As the bean itself is also used by non-custom components, I would like to avoid using additional ui:param (like described here Passing action in <rich:modalPanel> ) since it will essentially specify the same bean. Is it possible to specify component's action using bean name provided with ui:param ? Basically I am trying to achieve the following: <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"