You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rick Reumann <ri...@gmail.com> on 2006/04/15 08:06:01 UTC
narrowed it down to converter Re: Tiles headaches - should be simple
- driving me nuts here...
Rick Reumann wrote:
> I've used Tiles in the past. Started to implement it in this new app,
> and I keep getting error messages like...
>
> javax.servlet.jsp.JspException: Error - Tag Insert : No value found
> for attribute 'header'.
> at org.apache.struts.taglib.tiles.InsertTag.processAttribute(InsertTag.java:690)
> at org.apache.struts.taglib.tiles.InsertTag.createTagHandler(InsertTag.java:478)
> <snip/>
>
> Basically it seems as if none of the attributes I define in my tiles
> definition file are being able to be picked up by the main layout. I'm
> hoping someone can pick up something that I'm doing really dumb here.
Finally tracked down the main problem to my ServletContext listener. I
thought I had commented it out but I hadn't and never thought anything
in there could be screwing things up. Apparently Tiles gets screwed up
somehow based on a Converter I registered in my context listener class.
The one messing it up was the one that I declared as...
ConvertUtils.register(new CustomValueToStringConverter("MM/dd/yy"),
String.class);
Initially I was using it for dealing with some date stuff also but at
this time it's only doing:
public Object convert(Class type, Object value) {
Object returnValue = null;
if (value != null && type == String.class ) {
if ( value instanceof String) {
if ( value.toString().trim().length() == 0 ) {
returnValue = null;
} else {
returnValue = value.toString().trim();
}
}
//process String using standard converter
else {
returnValue = stringConverter.convert(type, value);
}
}
return returnValue;
}
I could work around not using this converter. I'm just curious why this
causes Tiles to blow up on setting attributes. I'm sure it's related to
BeanUtils and something I'm doing wrong.
Anyway, thanks guys for bearing with me. I should have commented out
that listener earlier on before posting, but I missed it. I'm just upset
it took me so long to track down the issue.
--
Rick
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org