beehive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eddie O'Neil (JIRA)" <...@beehive.apache.org>
Subject [jira] Resolved: (BEEHIVE-964) callPageFlow and callMethod tags don't handle arrays correctly
Date Thu, 06 Oct 2005 04:37:47 GMT
     [ http://issues.apache.org/jira/browse/BEEHIVE-964?page=all ]
     
Eddie O'Neil resolved BEEHIVE-964:
----------------------------------

    Resolution: Fixed

Fixed in SVN 306526.

> callPageFlow and callMethod tags don't handle arrays correctly
> --------------------------------------------------------------
>
>          Key: BEEHIVE-964
>          URL: http://issues.apache.org/jira/browse/BEEHIVE-964
>      Project: Beehive
>         Type: Bug
>   Components: NetUI
>     Versions: V1
>     Reporter: Eddie O'Neil
>      Fix For: 1.1

>
> This was sent to me privately -- the NetUI callPageFlow (and all call method tags) don't
handle Java primitive / object arrays correctly.  The problem is that the String type name
that the user specifies looks like:
>   java.lang.String[][]
> but this is compared against the Java Class type name:
>   [[Ljava.lang.String;
> and clearly, these two aren't equal.  Fix is to reformat the latter into the former and
the do the String compare.
> Repro:
> index.jsp
>    <%
>        String[] includedProperties = {"TITLE", "DESCRIPTION", "LINK_URL"};
>        pageContext.setAttribute("includedProperties", includedProperties);
>        pageContext.setAttribute("includedPropertiesList", Arrays.asList(includedProperties));
>    %>
>    <netui-data:callPageFlow method="thisIsATest" resultId="test1">
>        <netui-data:methodParameter type="java.lang.String" value="HMMMM"/>
>    </netui-data:callPageFlow>
>    <c:out value="${test1}"/><br/>
>    <netui-data:callPageFlow method="thisIsAnotherTest" resultId="test2">
>        <netui-data:methodParameter type="java.lang.String[]" value="${includedProperties}"/>
>    </netui-data:callPageFlow>
>    <c:out value="${test2}"/><br/>
>    <netui-data:callPageFlow method="thisIsAListTest" resultId="test3">
>        <netui-data:methodParameter type="java.util.List" value="${includedPropertiesList}"/>
>    </netui-data:callPageFlow>
>    <c:out value="${test3}"/><br/>
> Controller.jpf
>    public String thisIsATest(String test)
>    {
>        return test+"!!!!";
>    }
>    public String thisIsAnotherTest(String[] test)
>    {
>        return "Array Works!!!!";
>    }
>    public String thisIsAListTest(List test)
>    {
>        return "List Works!!!!";
>    }
> Final Output
>    HMMMM!!!!
>    Tag Error:1, Found in tag CallPageFlow]
>    List Works!!!!
>    Page Errors
>    Error Number Tag Type Error
>    1 CallPageFlow Message Could not find operation "thisIsAnotherTest" with 1 parameter(s)
of type(s) (java.lang.String[]) on the current page flow.
> The same thing happens with the 'callMethod' tag,

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message