tiles with spring : getting error - java.lang.ClassNotFoundException: org.apache.tiles.TilesApplicationContext

前端 未结 4 817
梦毁少年i
梦毁少年i 2021-01-11 22:22

I am new to spring and trying to use tiles with Spring. but getting above error. i am using maven in my project. i tried changing versions also, but no use. following are co

相关标签:
4条回答
  • 2021-01-11 22:32

    Finally it worked ! I replaced tiles2 by tiles3 as correctly pointed out by mck and added following line to tiles-definitions.xml

    <!DOCTYPE tiles-definitions PUBLIC
      "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN" 
      "http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
    
    0 讨论(0)
  • 2021-01-11 22:38

    In your servlet-context.xml you are using the tiles2 spring-tiles integration classes.

    Use instead the classes found under org.springframework.web.servlet.view.tiles3

    0 讨论(0)
  • 2021-01-11 22:48

    Using:

    import org.springframework.web.servlet.view.tiles3.TilesView;
    

    Not:

    import org.springframework.web.servlet.view.tiles2.TilesView;
    
    0 讨论(0)
  • 2021-01-11 22:51
    use this code if your are using version 3 . based on the version your are using should configure the tiles.
    <bean id="viewResolver"
            class="org.springframework.web.servlet.view.UrlBasedViewResolver">
            <property name="viewClass">
                <value>
                    org.springframework.web.servlet.view.tiles3.TilesView
                </value>
            </property>
        </bean>
        <bean id="tilesConfigurer"
            class="org.springframework.web.servlet.view.tiles3.TilesConfigurer">
            <property name="definitions">
                <list>
                    <value>/WEB-INF/estudo-tiles-servlet.xml</value>
                </list>
            </property>
        </bean>
    
    0 讨论(0)
提交回复
热议问题