MaheshG
MaheshG

Reputation: 41

Spring mvc tiles configuration

how to add spring tiles configuration feature through xml?...for example suppose If I've 1000+ tiles resolver xml files.how can I add those xml files ? I need to add all the xml files or is there any new feature to inject all files?

Upvotes: 0

Views: 92

Answers (1)

gipinani
gipinani

Reputation: 14398

You don't need to configure each view definition file. TilesConfigurer definitions property support wildcard characters.

In the following example TilesConfigurer will try to load all views.xml under any subpath of /WEB-INF/views/

<bean class="org.springframework.web.servlet.view.tiles2.TilesConfigurer" id="tilesConfigurer">
    <property name="definitions">
        <list>
            <value>/WEB-INF/layouts/layouts.xml</value>
            <!-- Scan views directory for Tiles configurations -->
            <value>/WEB-INF/views/**/views.xml</value>
        </list>
    </property>
</bean>

Hope this helps!

Upvotes: 1

Related Questions