You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Andre Huertas (JIRA)" <co...@jakarta.apache.org> on 2007/04/03 22:58:32 UTC

[jira] Commented: (JELLY-275) j:new casts objects to java.lang.String

    [ https://issues.apache.org/jira/browse/JELLY-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12486496 ] 

Andre Huertas commented on JELLY-275:
-------------------------------------

I created a little work around for this (but I'm new to this so I'm not sure if its kosher):

First I changed the the script to the following:

	<j:new var="foo" className="java.io.File" >
		<j:arg value="."/>
	</j:new>

	<j:invoke method="isFile" var="isFile" on="foo" />
		
Then in InvokeTag.java I made the following modifications:

...
    /** the name of the object to invoke the method on */
    private String on;
...
    public void setOn(String on) {
    	        this.on = on;
    }
...
[Inside the doTag() method]
Object onInstance = context.findVariable(on);




> j:new casts objects to java.lang.String
> ---------------------------------------
>
>                 Key: JELLY-275
>                 URL: https://issues.apache.org/jira/browse/JELLY-275
>             Project: Commons Jelly
>          Issue Type: Bug
>          Components: core / taglib.core
>    Affects Versions: 1.1.1
>            Reporter: Andre Huertas
>
> I execute the following Jelly script:
> 	<j:new var="foo" className="java.io.File" >
> 		<j:arg value="."/>
> 	</j:new>
> 	<j:invoke method="isFile" var="isFile" on="${foo}" />
> and get the following Exception when I do:
> java.lang.NoSuchMethodException: No such accessible method: isFile() on object: java.lang.String.
> The same happens if I use the <util:file> tag.
> When I take a look at my log4j file I see the following debug statement:
> DEBUG main org.apache.commons.beanutils.ConvertUtils - Convert string 'java.io.File' to class 'java.lang.String'

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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