Return-Path: Delivered-To: apmail-myfaces-dev-archive@www.apache.org Received: (qmail 81656 invoked from network); 1 Nov 2007 06:32:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Nov 2007 06:32:14 -0000 Received: (qmail 77625 invoked by uid 500); 1 Nov 2007 06:32:01 -0000 Delivered-To: apmail-myfaces-dev-archive@myfaces.apache.org Received: (qmail 77591 invoked by uid 500); 1 Nov 2007 06:32:01 -0000 Mailing-List: contact dev-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list dev@myfaces.apache.org Received: (qmail 77578 invoked by uid 99); 1 Nov 2007 06:32:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 Oct 2007 23:32:01 -0700 X-ASF-Spam-Status: No, hits=-98.0 required=10.0 tests=ALL_TRUSTED,URIBL_BLACK X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Nov 2007 06:32:11 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 5223B71422B for ; Wed, 31 Oct 2007 23:31:51 -0700 (PDT) Message-ID: <17057553.1193898711334.JavaMail.jira@brutus> Date: Wed, 31 Oct 2007 23:31:51 -0700 (PDT) From: "Leonardo Uribe (JIRA)" To: dev@myfaces.apache.org Subject: [jira] Updated: (MYFACES-1741) JSR-252 Issue 21 - Provided an additional "binding" attribute for the core Converter, Listener and Validator tags has wrong behaviour In-Reply-To: <11936202.1191793310656.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/MYFACES-1741?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Leonardo Uribe updated MYFACES-1741: ------------------------------------ Status: Patch Available (was: Open) > JSR-252 Issue 21 - Provided an additional "binding" attribute for the core Converter, Listener and Validator tags has wrong behaviour > ------------------------------------------------------------------------------------------------------------------------------------- > > Key: MYFACES-1741 > URL: https://issues.apache.org/jira/browse/MYFACES-1741 > Project: MyFaces Core > Issue Type: Bug > Components: JSR-252 > Affects Versions: 1.2.0 > Environment: Tomcat 6.0.14, Myfaces 1.2.1-SNAPSHOT (Oct 7 2007) > Reporter: Leonardo Uribe > Fix For: 1.2.1-SNAPSHOT > > Attachments: patchBindingCLVV.patch > > > There is a problem with the behaviour of binding attribute from actionListeners, validators and converters. > I have this test. The objective is explore how binding attribute is doing things comparing jsf ri 1.2 and > myfaces 1.2.1-SNAPSHOT, trying to detect bugs on myfaces :) > bindingCLV.jsp > <%@ page session="false" contentType="text/html;charset=utf-8"%> > <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> > <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%> > > afterPhase="#{bindingCLVBean.afterPhase}"> > <%@include file="inc/head.inc"%> > > basename="org.apache.myfaces.examples.resource.example_messages" > var="example_messages" /> >

Myfaces Examples JSF 1.2 Additions

> > > > > > > binding="#{bindingCLVBean.validatorBigint}"/> > > > > > > binding="#{bindingCLVBean.validatorBigdecimal}"/> > > > > > binding="#{bindingCLVBean.listener}" /> > > > >
> > Bean: > package org.apache.myfaces.bindingCLV; > import java.math.BigDecimal; > import java.math.BigInteger; > import javax.faces.application.FacesMessage; > import javax.faces.component.html.HtmlInputText; > import javax.faces.context.FacesContext; > import javax.faces.convert.Converter; > import javax.faces.event.ActionListener; > import javax.faces.event.PhaseEvent; > import javax.faces.validator.Validator; > import org.apache.commons.logging.Log; > import org.apache.commons.logging.LogFactory; > public class BindingCLVBean { > private BigInteger bigint; > > private BigDecimal bigdecimal; > > private Converter converterBigint; > > private Converter converterBigdecimal; > > private Validator validatorBigint; > > private Validator validatorBigdecimal; > > private HtmlInputText input1; > > private HtmlInputText input2; > > private ActionListener listener; > > Log log = LogFactory.getLog(BindingCLVBean.class); > > public void beforePhase(PhaseEvent phaseEvent){ > FacesContext facesContext = FacesContext.getCurrentInstance(); > > facesContext.addMessage(null, new FacesMessage("This is the message for phase before "+phaseEvent.getPhaseId().toString())); > facesContext.addMessage(null, new FacesMessage("Component:"+this.getInput1())); > facesContext.addMessage(null, new FacesMessage("Validator:"+this.getValidatorBigdecimal())); > facesContext.addMessage(null, new FacesMessage("Converter:"+this.getConverterBigdecimal())); > facesContext.addMessage(null, new FacesMessage("ActionListener:"+this.getListener())); > log.info("This is the message for phase before "+phaseEvent.getPhaseId().toString()+" : "); > } > > public void afterPhase(PhaseEvent phaseEvent){ > FacesContext facesContext = FacesContext.getCurrentInstance(); > > facesContext.addMessage(null, new FacesMessage("This is the message for phase after "+phaseEvent.getPhaseId().toString())); > facesContext.addMessage(null, new FacesMessage("Component:"+this.getInput1())); > facesContext.addMessage(null, new FacesMessage("Validator:"+this.getValidatorBigdecimal())); > facesContext.addMessage(null, new FacesMessage("Converter:"+this.getConverterBigdecimal())); > facesContext.addMessage(null, new FacesMessage("ActionListener:"+this.getListener())); > log.info("This is the message for phase after "+phaseEvent.getPhaseId().toString()+" : "); > } > > public BigInteger getBigint() { > return bigint; > } > public void setBigint(BigInteger bigint) { > this.bigint = bigint; > } > public BigDecimal getBigdecimal() { > return bigdecimal; > } > public void setBigdecimal(BigDecimal bigdecimal) { > this.bigdecimal = bigdecimal; > } > public Converter getConverterBigint() { > return converterBigint; > } > public void setConverterBigint(Converter converterBigint) { > this.converterBigint = converterBigint; > } > public Converter getConverterBigdecimal() { > return converterBigdecimal; > } > public void setConverterBigdecimal(Converter converterBigdecimal) { > this.converterBigdecimal = converterBigdecimal; > } > public Validator getValidatorBigint() { > return validatorBigint; > } > public void setValidatorBigint(Validator validatorBigint) { > this.validatorBigint = validatorBigint; > } > public Validator getValidatorBigdecimal() { > return validatorBigdecimal; > } > public void setValidatorBigdecimal(Validator validatorBigdecimal) { > this.validatorBigdecimal = validatorBigdecimal; > } > > public String update(){ > FacesContext context = FacesContext.getCurrentInstance(); > return "update"; > } > public HtmlInputText getInput1() { > return input1; > } > public void setInput1(HtmlInputText input1) { > this.input1 = input1; > } > public HtmlInputText getInput2() { > return input2; > } > public void setInput2(HtmlInputText input2) { > this.input2 = input2; > } > public ActionListener getListener() { > return listener; > } > public void setListener(ActionListener listener) { > this.listener = listener; > } > } > When you call the page the first time, this is the output for tag : > JSF RI: > * This is the message for phase before RENDER_RESPONSE 6 > * Component:javax.faces.component.html.HtmlInputText@164de59 > * Validator:null > * Converter:null > * ActionListener:null > Myfaces: > * This is the message for phase before RENDER_RESPONSE(6) > * Component:javax.faces.component.html.HtmlInputText@18c5e67 > * Validator:org.apache.myfaces.bindingCLV.DummyValidator@89c116 > * Converter:javax.faces.convert.BigDecimalConverter@1e3bbd7 > * ActionListener:org.apache.myfaces.bindingCLV.DummyActionListener@4133b0 > QUESTION 1: Why do I create an object that I do not use?. Myfaces is wrong, and JSF RI has the correct behaviour. > The first time that I load a page, it's unnecesary to create those objects. > And when you press the button or submit the form: > JSF RI: > * This is the message for phase before APPLY_REQUEST_VALUES 2 > * Component:javax.faces.component.html.HtmlInputText@14aa2db > * Validator:null > * Converter:null > * ActionListener:null > * This is the message for phase after APPLY_REQUEST_VALUES 2 > * Component:javax.faces.component.html.HtmlInputText@14aa2db > * Validator:null > * Converter:null > * ActionListener:null > * This is the message for phase before PROCESS_VALIDATIONS 3 > * Component:javax.faces.component.html.HtmlInputText@14aa2db > * Validator:null > * Converter:null > * ActionListener:null > * This is the message for phase after PROCESS_VALIDATIONS 3 > * Component:javax.faces.component.html.HtmlInputText@14aa2db > * Validator:org.apache.myfaces.bindingCLV.DummyValidator@10df4e2 > * Converter:javax.faces.convert.BigDecimalConverter@1485542 > * ActionListener:null > * This is the message for phase before UPDATE_MODEL_VALUES 4 > * Component:javax.faces.component.html.HtmlInputText@14aa2db > * Validator:org.apache.myfaces.bindingCLV.DummyValidator@10df4e2 > * Converter:javax.faces.convert.BigDecimalConverter@1485542 > * ActionListener:null > * This is the message for phase after UPDATE_MODEL_VALUES 4 > * Component:javax.faces.component.html.HtmlInputText@14aa2db > * Validator:org.apache.myfaces.bindingCLV.DummyValidator@10df4e2 > * Converter:javax.faces.convert.BigDecimalConverter@1485542 > * ActionListener:null > * This is the message for phase before INVOKE_APPLICATION 5 > * Component:javax.faces.component.html.HtmlInputText@14aa2db > * Validator:org.apache.myfaces.bindingCLV.DummyValidator@10df4e2 > * Converter:javax.faces.convert.BigDecimalConverter@1485542 > * ActionListener:null > * This is the message for phase after INVOKE_APPLICATION 5 > * Component:javax.faces.component.html.HtmlInputText@14aa2db > * Validator:org.apache.myfaces.bindingCLV.DummyValidator@10df4e2 > * Converter:javax.faces.convert.BigDecimalConverter@1485542 > * ActionListener:org.apache.myfaces.bindingCLV.DummyActionListener@391da0 > * This is the message for phase before RENDER_RESPONSE 6 > * Component:javax.faces.component.html.HtmlInputText@14aa2db > * Validator:org.apache.myfaces.bindingCLV.DummyValidator@10df4e2 > * Converter:javax.faces.convert.BigDecimalConverter@1485542 > * ActionListener:org.apache.myfaces.bindingCLV.DummyActionListener@391da0 > Myfaces: > * This is the message for phase before APPLY_REQUEST_VALUES(2) > * Component:javax.faces.component.html.HtmlInputText@16752c9 > * Validator:null > * Converter:null > * ActionListener:null > * This is the message for phase after APPLY_REQUEST_VALUES(2) > * Component:javax.faces.component.html.HtmlInputText@16752c9 > * Validator:null > * Converter:null > * ActionListener:null > * This is the message for phase before PROCESS_VALIDATIONS(3) > * Component:javax.faces.component.html.HtmlInputText@16752c9 > * Validator:null > * Converter:null > * ActionListener:null > * This is the message for phase after PROCESS_VALIDATIONS(3) > * Component:javax.faces.component.html.HtmlInputText@16752c9 > * Validator:null > * Converter:null > * ActionListener:null > * This is the message for phase before UPDATE_MODEL_VALUES(4) > * Component:javax.faces.component.html.HtmlInputText@16752c9 > * Validator:null > * Converter:null > * ActionListener:null > * This is the message for phase after UPDATE_MODEL_VALUES(4) > * Component:javax.faces.component.html.HtmlInputText@16752c9 > * Validator:null > * Converter:null > * ActionListener:null > * This is the message for phase before INVOKE_APPLICATION(5) > * Component:javax.faces.component.html.HtmlInputText@16752c9 > * Validator:null > * Converter:null > * ActionListener:null > * This is the message for phase after INVOKE_APPLICATION(5) > * Component:javax.faces.component.html.HtmlInputText@16752c9 > * Validator:null > * Converter:null > * ActionListener:null > * This is the message for phase before RENDER_RESPONSE(6) > * Component:javax.faces.component.html.HtmlInputText@16752c9 > * Validator:org.apache.myfaces.bindingCLV.DummyValidator@1c958af > * Converter:javax.faces.convert.BigDecimalConverter@1dd7736 > * ActionListener:org.apache.myfaces.bindingCLV.DummyActionListener@bd93cd > QUESTION 2: Why I not have bindings assigned before INVOKE_APPLICATION ?(in this time is of value have a binding attribute) . > Again JSF RI has the correct behaviour and Myfaces is wrong. Myfaces create the validators, converters and > actionListeners on correct time, but not assign bindings when is supposed to do. If I assign a binding for > converter, validator or actionListener, I should be assigned minimum before INVOKE_APPLICATION, or better, > converters and validators on PROCESS_VALIDATIONS, and actionListeners in INVOKE_APPLICATION. > Looks a little bit difficult but I will try to find a solution for this issue. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.