tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 50449] New: Methodexpression with arguments fails in JSF composite component
Date Fri, 10 Dec 2010 02:46:17 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=50449

           Summary: Methodexpression with arguments fails in JSF composite
                    component
           Product: Tomcat 7
           Version: 7.0.5
          Platform: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: balusc@gmail.com


When a methodexpression with arguments is invoked in a JSF composite component,
Tomcat 7.0.5 EL fails to locate the right method. This works fine in Glassfish
3.0.1, so it's likely not a JSF/Facelets issue.

Below testcase requires the Mojarra 2.0.3 API and Impl JAR's in /WEB-INF/lib.

test.xhtml
----------------------------------------
<!DOCTYPE html>
<html lang="en"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:cc="http://java.sun.com/jsf/composite/components">
    <h:head>
        <title>Test</title>
    </h:head>
    <h:body>
        <h1>Inline components</h1>
        <h:form>
            <h:commandButton value="submit without argument" 
                action="#{bean.submit}" />
            <h:commandButton value="submit with argument" 
                action="#{bean.submit('test')}" />
        </h:form>    
        <h1>Composite component</h1>
        <cc:test bean="#{bean}" />
    </h:body>  
</html>
----------------------------------------

resources/components/test.xhtml
----------------------------------------
<!DOCTYPE html>
<html lang="en"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:cc="http://java.sun.com/jsf/composite">
    <cc:interface>
        <cc:attribute name="bean" required="true" />
    </cc:interface>
    <cc:implementation>
        <h:form>
            <h:commandButton value="submit without argument" 
                action="#{cc.attrs.bean.submit}" />
            <h:commandButton value="submit with argument"
                action="#{cc.attrs.bean.submit('test')}" />
        </h:form>    
    </cc:implementation>
</html>
----------------------------------------

com.example.Bean
----------------------------------------
package com.example;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

@ManagedBean
@RequestScoped
public class Bean {
    public void submit() { 
        System.out.println("submit");
    }

    public void submit(String string) {
        System.out.println("submit with string: " + string);
    }
}
----------------------------------------

When running on Tomcat 7.0.5, the submit with argument on a JSF composite
component will submit to the method without argument. When the method without
argument is outcommented in bean, a javax.el.MethodNotFoundException is been
thrown. While not immediately visible in the stacktrace, under the covers
Tomcat seems to be returning the wrong method for the method expression.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message