Results 1 to 3 of 3

Thread: Integratin Tiles and Spring - page not rendering

  1. #1

    Default Integratin Tiles and Spring - page not rendering

    Hello,

    I am trying to integrate Tiles with Spring. I have created a simple baselayout that is used by tiles and that the other views will extend. I believe that I added the correct information to the supporting xml configuration files.

    I have added the "viewResolver" as follows:


    <bean id="viewResolver" class="org.springframework.web.servlet.view.Intern alResourceViewResolver">
    <property name="requestContextAttribute"><value>requestConte xt</value></property>
    <property name="viewClass"><value>org.springframework.web.se rvlet.view.tiles.TilesJstlView</value></property>
    </bean>


    I looking at the log file, it appears as though tiles is bein initialized correctly. However when every I hit the site, I get redirected to the appropriate "baselayout", but none of the <tiles:> tags are processed, they just show up in the rendered html. Any ideas what I am missing?

    I am sure I must be missing something fairly obvious, but I do not see it.

    Thanks in advance for your assistance.

    Regards,
    Todd

  2. #2
    Join Date
    Aug 2004
    Location
    München/Germany
    Posts
    7

    Default

    Hi Todd,
    here can you see my working configuraton for tiles in spring, may you find the missing point in your config:

    webapp-servlet.xml:

    Code:
    ...
    <!-- Tiles -->
        <bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles.TilesConfigurer">
            <property name="factoryClass">
                <value>org.apache.struts.tiles.xmlDefinition.I18nFactorySet</value>
            </property>
            <property name="definitions">
                <list>
                    <value>/WEB-INF/tiles-config.xml</value>
                </list>
            </property>
        </bean>
        <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
            <property name="viewClass">
                <value>org.springframework.web.servlet.view.tiles.TilesJstlView</value>
            </property>
        </bean>
    ...

    web.xml:

    Code:
       
    ....
    <taglib>
            <taglib-uri>tiles</taglib-uri>
            <taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
        </taglib>
    ...
    In your jsp you have to include the tag lib:

    Code:
    <%@ taglib prefix="tiles" uri="http&#58;//jakarta.apache.org/struts/tags-tiles" %>
    Hope that helps...
    markus

  3. #3

    Default Integrating Tiles and Spring - page not rendering (fixed)

    Markus,

    Thanks for the input, I found the error, a silly one at that. I have a .jsp that is included in my pages that define all the taglibs to be used, and I neglected to add the reference to the tiles tag lib.

    Thanks again for the help.

    Regards,
    Todd

Similar Threads

  1. Spring & Tiles
    By LilienfeldK in forum Web
    Replies: 7
    Last Post: Dec 28th, 2008, 10:04 PM
  2. Replies: 1
    Last Post: Oct 21st, 2005, 05:27 AM
  3. Spring MVC Component-like Controllers
    By harmen in forum Web
    Replies: 4
    Last Post: Aug 8th, 2005, 01:58 AM
  4. Replies: 0
    Last Post: Jun 10th, 2005, 08:22 AM
  5. Replies: 2
    Last Post: Feb 10th, 2005, 03:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •