You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tiles.apache.org by Adam Hardy <ah...@cyberspaceroad.com> on 2007/09/01 20:52:54 UTC

Re: NOT re: JSTL variable attributes......

Antonio Petrelli on 29/08/07 07:46, wrote:
> 2007/8/29, Adam Hardy <ah...@cyberspaceroad.com>:
>> However it doesn't really give much of an idea of what you mean. A 'hint'?
>> Presumably this means that your code checks whether this attribute is null
>> before executing an algorithm to establish what exactly the put-attribute
>> is defining?
> 
> I will try to clarify it with an example. Suppose that you declared a Tiles
> definition called "my.definition", but you want to put the value
> "my.definition" as a string. In this case, you need to use: type="string" 
> otherwise the "my.definition" definition will be used.

Thanks for the clarification.

I was confused by tiles' handling of a simple configuration error I had made. 
Tiles by default just ignored my attempt to insert a JSP, because I had given 
the wrong directory in the tiles.xml, therefore I was effectively trying to 
insert a non-existent JSP with a tiles:insertAttribute tag.

I think it would certainly have been desirable in this case to throw an 
exception and ditch the response, however I can't see a way to configure that 
and it's too late to help now anyway. It may be advantageous though to configure 
tiles that way by default to minimise frustration for newbies such as myself.

It did occur to me though that the handling of insertion of non-existent JSPs 
may be container-dependent. A recent porting of a tiles-1.0 app to Websphere 
revealed that it throws exceptions if I tried to insert a zero-length string as 
the name of a JSP.

It meant I had to insert an empty "blank.jsp" file as the value for attributes 
in my abstract tile definition which other tiles could choose override if 
desired - i.e. leaving the attributes as "" causes Websphere to throw an exception.

I haven't got so far as deploying to Websphere with my current app so I can't 
say whether this still applies in tiles-2. The tiles-2 ability to create 
extending definitions that can define new attributes not declared in the 
abstract definition may be a feature that circumvents that old tiles-1 Websphere 
issue - hopefully. I can let you know if I upgrade that old tiles-1 app to 
tiles-2 at some point. (Would love to but it's not one of the priorities at the 
moment!)

Best regards
Adam