Announcement Announcement Module
Collapse
No announcement yet.
Integratin Tiles and Spring - page not rendering Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      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

      Comment

      Working...
      X