This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Spring Tiles

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please someone help me, I am trying to incorporate Tiles with Spring. I have experience with both but I have never set them up so I don't know where I am going wrong.

The error I am getting is this:
javax.servlet.ServletException: Could not get RequestDispatcher for [page.index]: check that this file exists within your WAR

I don't know what the RequestDispather is, so I dont know what the error means.

page.index is the id for my tiles definition. and the pages do exists.


Here are my files with the Tiles configuration.


1. springapp-servlet.xml:
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="requestContextAttribute" value="requestContext"/>
<property name="viewClass" value="org.springframework.web.servlet.view.tiles.TilesView"/>
</bean>

<bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles.TilesConfigurer">

<property name="factoryClass"
value="org.apache.struts.tiles.xmlDefinition.I18nFactorySet" />
<property name="definitions">
<list>
<value>/WEB-INF/tiles-defs.xml</value>
</list>
</property>
</bean>



2. in my web.xml:
<taglib>
<taglib-uri>/WEB-INF/tld/struts-tiles.tld</taglib-uri>
<taglib-location>/WEB-INF/tld/struts-tiles.tld</taglib-location>
</taglib>

Please help.
 
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Guille,

the configuration that you show looks fine to me.

Can you show us (part of)your tiles-defs.xml?

Make sure that your DispatcherServlet in the web.xml is called 'springapp', so that it points to springapp-servlet.xml

Herman
 
Guille Carlos
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WOOO HOOO!
Ok I got it!

And I feel really stupid about this but oh well it happens.

The problem was my path in the tiles-def.xml

I had:
TestApp/WEB-INF/jsp/layout/header.jsp

Instead of just:
/WEB-INF/jsp/layout/header.jsp

Anyways I hope this helps someone else.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using spring 2.5 and Tiles 2.06, could you please post the configuration for integrating both as well the as the jsp configuration, what are the exact jar file with version.

Thanks
Sridhar
 
Live ordinary life in an extraordinary way. Details embedded in this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!