tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric B <ebe...@hotmail.com>
Subject Re: OptionsRenderer not working
Date Mon, 28 Oct 2013 17:44:36 GMT
On 13-10-28 12:08 PM, Mick Semb Wever wrote:
> ClamAV 0.96.5
>
>
>> But if you read the code, you see that FileNotFound is actually never thrown.  Since
FileNotFoundException is a subclass of IOException, the exception
>> is caught and wrapped in an IllegalArgumentException, which is a runtime exception.
 renderAttempt() only tries to catch FileNotFound exceptions,
>> which are never actually thrown, and consequently, it is never able to process the
different options.
>
>
> Yeah you're quite right! and my very poor memory failed to catch this.
>
> OptionsRenderer is already patched to address this
> http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-extras/src/main/java/org/apache/tiles/extras/renderer/OptionsRenderer.java?r1=1368433&r2=1422025
>
> The reason for the ResourceLoader throwing a RuntimeException and not a
> checked exception is up to Spring, not tiles.
>
> I will start the process for a new release of tiles, in the meantime i
> suggest you continue with tiles-extras-3.0.2-SNAPSHOT.jar
>

ACK!

I'm not sure if I am happy or sad to hear that after the numerous hours I've spent trying
to track this down! :)  Definitely happy to hear that it has 
already been resolved though.  Would have been even happier had I found references that showed
it as a problem already fixed. :)  Hopefully if anyone 
lands on Tiles-572, it can reflect that it was a bug fixed in 3.0.2.

In the meantime, I wrote up a hacky Aspect to intercept the RuntimeException and throw the
cause instead when OptionRenderer is the caller.  But your 
fix is probably a little easier to follow.  My concern with the fix, however, is that you
are relying on the toString() of the resource, which is 
something someone can modify inadvertently without realizing the downstream problems it would
be causing.  But it looks fairly safe enough.

Can you please update your Blog with the relevant information in the meantime?  ie: ensuring
the "cascade=true" is present in the list-attributes and 
indicate that it requires 3.0.2-SNAPSHOT at the minimum to be functional?

Finally, I ran into one last problem with your Blog example, but don't want to pollute this
thread with cross references.  Will create another thread 
with the problem.

Thanks,

Eric



Mime
View raw message