Announcement Announcement Module
Collapse
No announcement yet.
Tiles configuration using XmlViewResolver BeanCreationException Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Tiles configuration using XmlViewResolver BeanCreationException

    I am getting following error :
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'focalpointHomeView' defined in ServletContext resource [/WEB-
    INF/springapp-views.xml]: Initialization of bean failed; nested exception is org
    .springframework.context.ApplicationContextExcepti on: Tiles definitions factory
    not found: TilesConfigurer not defined?


    spring-servlet.xml
    ------------------
    <bean id="xmlViewResolver" class="org.springframework.web.servlet.view.XmlVie wResolver">
    <property name="order" value="0"/>
    <property name="location" value="/WEB-INF/springapp-views.xml"/>
    </bean>

    <bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles. TilesConfigurer">
    <property name="factoryClass" value="org.apache.struts.tiles.xmlDefinition.I18nF actorySet"/>
    <property name="validateDefinitions"><value>false</value></property>
    <property name="definitions">
    <list>
    <value>/WEB-INF/tile-defs/tiles-defs.xml</value>
    </list>
    </property>
    </bean>


    springapp-views.xml
    -------------------

    <bean name="focalpointHomeView"
    class="org.springframework.web.servlet.view.tiles. TilesJstlView">
    <property name="url">
    <value>homeTilePage</value>
    </property>
    </bean>

    Tiles-defs.xml
    ------------

    <tiles-definitions>
    <definition name="homeTilePage" path="/WEB-INF/jsp/layouts/basicLayout.jsp">
    <put name="pageHeader" value="/WEB-INF/jsp/pageHeader.jsp" />
    <put name="pageMain" value="/WEB-INF/jsp/pageMain.jsp" />
    <put name="pageFooter" value="/WEB-INF/jsp/pageFooter.jsp" />
    </definition>
    </tiles-definitions>

    Plaese let me know how this could be solved?

  • #2
    I could able to solve this , with the following soultion

    1. remove tilesConfigurator from springapp-servlet.xml.

    2. add tileconfigurator in applicationContext.xml

    <bean id="tilesConfigurer"
    class="org.springframework.web.servlet.view.tiles. TilesConfigurer">
    <property name="factoryClass"
    value="org.apache.struts.tiles.xmlDefinition.I18nF actorySet" />
    <property name="validateDefinitions">
    <value>false</value>
    </property>
    <property name="definitions">
    <list>
    <value>/WEB-INF/tile-defs/tiles-defs.xml</value>
    </list>
    </property>
    </bean>

    3. Add contextConfigLocation and listener to web.xml

    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/applicationContext.xml</param-value>
    </context-param>


    <listener>
    <listener-class>
    org.springframework.web.context.ContextLoaderListe ner
    </listener-class>
    </listener>


    Hope this solution may useful, if if you wish to use views.xml

    Thanks
    Markandeya Thoutam

    Comment

    Working...
    X