Results 1 to 7 of 7

Thread: Tiles2 Problem

  1. #1
    Join Date
    Jun 2008
    Location
    Antwerp
    Posts
    1

    Default Tiles2 Problem

    I ran into a little problem wit tiles2.
    The error I get is:
    SEVERE: Servlet.service() for servlet dispatcher threw exception
    java.io.IOException: No request dispatcher returned for path 'null'

    Here is my config:

    Dispatcher-servlet.xml:
    Code:
        <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
            <property name="mappings">
                <props>
                    <prop key="/index.htm">indexController</prop>
                    <prop key="/admin/addLink.htm">addLinkController</prop>
                </props>
            </property>
        </bean>
    
        <bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
            <property name="viewClass" value="org.springframework.web.servlet.view.tiles2.TilesView"/>
        </bean>
        <!-- 
            Tiles configurer
        -->
        <bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
          <property name="definitions">
            <list>
              <value>/WEB-INF/tiles-config.xml</value>
            </list>
          </property>
        </bean>
    tiles-config.xml
    Code:
        <!-- Administration template -->
        <definition name="adminTemplate" page="/WEB-INF/jsp/admin/template.jsp">
            <put name="header" content="/WEB-INF/jsp/admin/header.jsp"></put>
            <put name="content" content="dummyContentPage.jsp"></put>
        </definition>
        <!-- Standard template -->
        <definition name="template">
            <!-- todo -->
        </definition>
        
        <!-- 
        WEB PAGES
        -->
        <definition name="index" extends="template">
            <put name="content" value="/WEB-INF/jsp/index.jsp" />
        </definition>
        <!--
        ADMIN PAGES
        -->
        <definition name="admin/addLink" extends="adminTemplate">
            <put name="content" value="/WEB-INF/jsp/admin/addLink.jsp"/>
        </definition>
    Thanks for the help
    Y.

  2. #2
    Join Date
    Jul 2008
    Posts
    5

    Default

    Did this ever get solved? I'm having the exact same problem.

  3. #3
    Join Date
    Jul 2008
    Posts
    2

    Smile oh...

    I have the same problem... however I need to solve it. That's why wait for reply

  4. #4
    Join Date
    Jul 2008
    Posts
    2

    Talking oh yes, baby!

    Problem with struts2 which in spring 2.x.

    Code:
    <bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles.TilesConfigurer">
            <property name="definitions">
                <list>
                    <value>/WEB-INF/tiles-defs.xml</value>
                </list>
            </property>
        </bean>
        <bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
            <property name="viewClass" value="org.springframework.web.servlet.view.tiles.TilesView"/>
        </bean>
    replace usage of org.springframework.web.servlet.view.tiles2 with tiles. That's all.
    Maybe in tiles2 some another working mechanism ...

  5. #5

    Default Solution for using tiles2

    If you upgraded from tiles 1.x the error can be traced to the tiles definitions xml.

    try upgrading to
    Code:
    <!DOCTYPE tiles-definitions PUBLIC
           "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
           "http://tiles.apache.org/dtds/tiles-config_2_0.dtd">
    Adapt the definitions file and your jsps to reflect tiles2!
    cheers
    mp

  6. #6

    Talking it works!

    Quote Originally Posted by merryploughboy View Post
    If you upgraded from tiles 1.x the error can be traced to the tiles definitions xml.

    try upgrading to
    Code:
    <!DOCTYPE tiles-definitions PUBLIC
           "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
           "http://tiles.apache.org/dtds/tiles-config_2_0.dtd">
    Adapt the definitions file and your jsps to reflect tiles2!
    cheers
    mp
    good call merryploughboy. moral of the story (for me at least):
    don't copy samples from 2 different websites.

  7. #7

    Default

    Great, someone has solved the similar problem I'm facing now. Thanks!

Posting Permissions

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