tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roshni Basu <roshni...@gmail.com>
Subject Re: Issue with putAttribute tag
Date Thu, 16 Jul 2009 09:40:57 GMT

Hi Antonio,
I had tried with ignore="true" but still it was throwing exception.
What I have observed is in ImportAttributeTag.java in tiles 2.1.2, in 
private void importAttributes(Collection<String> names) method,
there is a null check of attributeValue
 if (attributeValue == null) {
                        throw new TilesJspException(
                                "Error importing attributes. " + "Attribute
'"
                                        + name + "' has a null value ");
                    }
but "ignore" was not checked whether true or false.
I changed the above piece of code to 
 if (attributeValue == null&& !ignore) {
                        throw new TilesJspException(
                                "Error importing attributes. " + "Attribute
'"
                                        + name + "' has a null value ");
                    }

And ignore="true" worked. I think this is a bug in Tiles2.1.2.  Can you
kindly check this issue?


Antonio Petrelli-3 wrote:
> 
> 2009/7/10 Roshni Basu <roshniblr@gmail.com>:
>>
>> But in both casestiles1 and tiles2 header value has null value.
>> In case of tiles1 it does not throw any exception when this value is
>> null.
>> Whereas exception occurs in case of tiles2.
>> I'm confused.
> 
> If you don't want to throw exceptions, use the ignore="true" in the
> <tiles:insertAttribute> tag.
> Anyway notice that the NPE is useful to track bugs on your side, so
> use it paying attention.
> 
> Antonio
> 
> 

-- 
View this message in context: http://www.nabble.com/Issue-with-putAttribute-tag-tp24353360p24513330.html
Sent from the tiles users mailing list archive at Nabble.com.


Mime
View raw message