1

I am trying to integrate Spring tiles in my project. I am using spring framework 3.1.1 jars.

i have integrated spring tiles and it is working fine when i declare multiple defination blocks for each jsp page.

But when i use wild card * getting exception and i am not able to solve.

<definition name="base.definition" template="/WEB-INF/views/mainTemplate.jsp"> <put-attribute name="title" value=""></put-attribute> <put-attribute name="header" value="/WEB-INF/views/header.jsp"></put-attribute> <put-attribute name="menu" value="/WEB-INF/views/menu.jsp"></put-attribute> <put-attribute name="body" value=""></put-attribute> <put-attribute name="footer" value="/WEB-INF/views/footer.jsp"></put-attribute> </definition>

<definition name="*" extends="base.definition"> <put-attribute name="title" value=""></put-attribute> <put-attribute name="body" value="/WEB-INF/views/{1}.jsp"></put-attribute> </definition>

Please share me what jars i need to use.

Mohammed Farooq
  • 227
  • 1
  • 5
  • 23

2 Answers2

1

I use <dependency> <groupId>org.apache.tiles</groupId> <artifactId>tiles-jsp</artifactId> <version>3.0.1</version> </dependency>

which in turn brings in a whole bunch of dependencies.

geoand
  • 60,071
  • 24
  • 172
  • 190
  • Yes i have changed tiles2.2 version to tiles3.0 but still am facing the same problem. Multiple defination blocks works fine but when i use wild card getting exception on server console and not rendering the page – Mohammed Farooq Mar 17 '14 at 14:32
1

Issue is solved, I am using the following jars.

  1. tiles-api 3.0.1 jar
  2. tiles-core 3.0.1 jar
  3. tiles-jsp 3.0.1 jar
  4. tiles-request-api 1.0.1 jar
  5. commons-digester 2.0 jar
  6. commons-beanutils 1.8.0 jar

It worked when i commented the "title" from mytemplate.jsp.

I have commented the title in template.jsp and i have used wildcard to render jsp's it is working like charm for any condition like as follows

<definition name="*" extends="base.definition">
    <put-attribute name="title" value="{1}"></put-attribute>
    <put-attribute name="body" value="/WEB-INF/views/{1}.jsp"></put-attribute>
</definition>

<definition name="*/*" extends="base.definition">
    <put-attribute name="title" value="{1}"></put-attribute>
    <put-attribute name="body" value="/WEB-INF/views/{1}/{2}.jsp"></put-attribute>
</definition>
Mohammed Farooq
  • 227
  • 1
  • 5
  • 23