Re: freemarker.template.TemplateModelException: Attribute with name not found

Amin Mohammed-Coleman <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
Hi

I'm not sure if I follow. The personalContact is available outside the  
tags. It doesn't exist inside the tile definition.

There must be a way to achieve this...

Cheers

Amin


On 27 Mar 2009, at 23:49, Daniel Dekany <[email protected]> wrote:

> Friday, March 27, 2009, 11:02:50 PM, amin1977 wrote:
>
>> Hi
>>
>> Sorry to bring this up again, however I was wondering if someone  
>> may be able
>> to help with the below problem.  I have tried everything that I can  
>> think
>> of.
>
> Well, the error message says that the JSP directive that you call has
> no "personalContact" attribute. Are you sure it has it, exactly
> written like that?
>
>>
>> Cheers
>> Amin
>>
>>
>> amin1977 wrote:
>>>
>>> Hi
>>>
>>> I have a java object which I am passing into a tiles tag. For  
>>> example:
>>>
>>> I can print out pcobj outside of the tags
>>>
>>>
>>> <@tiles.insertDefinition name="pagination.tile">
>>>      <@tiles.putAttribute name="personalContact" value=pcobj />
>>> </@tiles.insertDefinition>
>>>
>>>
>>> in my pagination tile I am doing:
>>>
>>>
>>> <@tiles.importAttribute name="personalContact" />
>>>
>>> EMAIL : ${personalContact.email} <br/>
>>> FIRST NAME: ${personalContact.firstName} <br/>
>>> LAST NAME: ${personalContact.lastName} <br/>
>>>
>>>
>>> However I am getting the following
>>>
>>> Attribute with name 'personalContact' not found
>>> The problematic instruction:
>>> ----------
>>> ==> user-directive tiles.importAttribute [on line 3, column 1 in
>>> WEB-INF/freemarker/pagination.ftl]
>>> ----------
>>>
>>> Java backtrace for programmers:
>>> ----------
>>> freemarker.template.TemplateModelException: Attribute with name
>>> 'personalContact' not found
>>>      at
>>> freemarker.ext.jsp.TagTransformModel 
>>> $TagWriter.onStart(TagTransformModel.java:479)
>>>      at freemarker.core.Environment.visit(Environment.java:230)
>>>      at freemarker.core.UnifiedCall.accept(UnifiedCall.java:116)
>>>      at freemarker.core.Environment.visit(Environment.java:196)
>>>      at freemarker.core.MixedContent.accept(MixedContent.java:92)
>>>      at freemarker.core.Environment.visit(Environment.java:196)
>>>      at freemarker.core.Environment.process(Environment.java:176)
>>>      at freemarker.template.Template.process(Template.java:232)
>>>
>>>
>>> I would be grateful if anyone could advise me on what i'm doing  
>>> wrong..
>>>
>>> Cheers
>>>
>>>
>>>
>>
>
> -- 
> Best regards,
> Daniel Dekany
>

------------------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.