Hi

I have checked out trunk and I am trying to use the tiles-freemarker
component.  Is there any documentation on how to use the component?  I can't
see any of the freemarker support classes being invovked when I debug.  As I
mentioned earlier i am using freemarker jsp tag support.


Cheers
Amin

On Mon, Mar 30, 2009 at 8:21 AM, Amin Mohammed-Coleman <[email protected]>wrote:

> Hi
>
> I updated my freemarker to 2.3.15 and this fixed the NoClassDefException.
> However I am back to square one.  I can't seem to insert the object
> personalContact into the tile defintiion.  I am using freemarker support for
> JSP.  I would be grateful if anyone could assist.
>
> Cheers
> Amin
>
>
> On Sat, Mar 28, 2009 at 6:27 PM, Amin Mohammed-Coleman 
> <[email protected]>wrote:
>
>> Hi again
>> I checked out tiles trunk and added teh following in my classpath:
>>
>> <dependency>
>>
>> <groupId>org.apache.tiles</groupId>
>>
>> <artifactId>tiles-core</artifactId>
>>
>> <version>2.2.0-SNAPSHOT</version>
>>
>> <scope>compile</scope>
>>
>> </dependency>
>>
>> <dependency>
>>
>> <groupId>org.apache.tiles</groupId>
>>
>> <artifactId>tiles-api</artifactId>
>>
>> <version>2.2.0-SNAPSHOT</version>
>>
>> <scope>compile</scope>
>>
>> </dependency>
>>
>> <dependency>
>>
>> <groupId>org.apache.tiles</groupId>
>>
>> <artifactId>tiles-jsp</artifactId>
>>
>> <version>2.2.0-SNAPSHOT</version>
>>
>> <scope>compile</scope>
>>
>> </dependency>
>>
>> <dependency>
>>
>> <groupId>org.apache.tiles</groupId>
>>
>> <artifactId>tiles-servlet</artifactId>
>>
>> <version>2.2.0-SNAPSHOT</version>
>>
>> <scope>compile</scope>
>>
>> </dependency>
>>
>> <dependency>
>>
>> <groupId>org.apache.tiles</groupId>
>>
>> <artifactId>tiles-freemarker</artifactId>
>>
>> <version>2.2.0-SNAPSHOT</version>
>>
>> <scope>compile</scope>
>>
>> </dependency>
>>
>> <dependency>
>>
>> <groupId>org.apache.tiles</groupId>
>>
>> <artifactId>tiles-portlet</artifactId>
>>
>> <version>2.2.0-SNAPSHOT</version>
>>
>> <scope>compile</scope>
>>
>> </dependency>
>>
>> and modified my web.xml to be:
>>
>> <servlet>
>>
>> <servlet-name>freemarker</servlet-name>
>>
>>
>> <servlet-class>org.apache.tiles.freemarker.servlet.TilesFreemarkerServlet</servlet-class>
>>
>> <init-param>
>>
>> <param-name>TemplatePath</param-name>
>>
>> <param-value>/</param-value>
>>
>> </init-param>
>>
>> <init-param>
>>
>> <param-name>NoCache</param-name>
>>
>> <param-value>true</param-value>
>>
>> </init-param>
>>
>> <init-param>
>>
>> <param-name>ContentType</param-name>
>>
>> <param-value>text/html</param-value>
>>
>> </init-param>
>>
>> <init-param>
>>
>> <param-name>template_update_delay</param-name>
>>
>> <param-value>0</param-value> <!-- 0 is for development only! Use higher
>> value otherwise. -->
>>
>> </init-param>
>>
>> <init-param>
>>
>> <param-name>default_encoding</param-name>
>>
>> <param-value>ISO-8859-1</param-value>
>>
>> </init-param>
>>
>> <init-param>
>>
>> <param-name>number_format</param-name>
>>
>> <param-value>0.#####</param-value>
>>
>> </init-param>
>>
>> <load-on-startup>1</load-on-startup>
>>
>> </servlet>
>>
>> <servlet-mapping>
>>
>> <servlet-name>freemarker</servlet-name>
>>
>> <url-pattern>*.ftl</url-pattern>
>>
>> </servlet-mapping>
>>
>> however I am now getting:
>>
>> java.lang.NoClassDefFoundError:
>> org/apache/tiles/freemarker/template/AddAttributeFMModel
>>
>> org.apache.tiles.freemarker.template.TilesFMModelRepository.<init>(TilesFMModelRepository.java:106)
>>
>> org.apache.tiles.freemarker.servlet.TilesFreemarkerServlet.createConfiguration(TilesFreemarkerServlet.java:44)
>> freemarker.ext.servlet.FreemarkerServlet.init(FreemarkerServlet.java:230)
>> javax.servlet.GenericServlet.init(GenericServlet.java:212)
>>
>> I know the jar is on the classpath of the web application.  Any ideas on
>> what I may be doing wrong? I checked out trunk because someone mentioned
>> that the below problem maybe resolved in trunk.
>>
>> Cheers
>> Amin
>>
>> On Sat, Mar 28, 2009 at 1:52 PM, Amin Mohammed-Coleman <[email protected]>
>> 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
>> > Amin
>>
>
>

Reply via email to