Spring MVC and Tiles 3 views resolve


I am wondering if the Spring plugin is able to resolve Tiles 3 views? IDEA-94803 seems to indicate this is possible, but I can't get it to work, perhaps I am missing some configuration?

My project uses Spring MVC 3.2 and Tiles 3. Here's the relevant part of the Spring configuration:

     <context:annotation-config />      <context:component-scan base-package="com.blah.webapp"/>      <mvc:annotation-driven/>      <bean id="viewResolver" >           <property name="viewClass" value="org.springframework.web.servlet.view.tiles3.TilesView"/>      </bean>            <bean id="tilesConfigurer" >           <property name="definitions">                <list>                     <value>/WEB-INF/tiles/general.xml</value>                </list>           </property>      </bean>

Tiles definitions in /WEB-INF/tiles/general.xml:

<tiles-definitions>      <definition name="base.definition" template="/WEB-INF/layout/layout.jsp">
          ...      </definition>      <definition name="private/referentiel/listeReferentiels" extends="base.definition">
          ...      </definition>


In my annotated controller which does a `return "private/referentiel/listeReferentiels"`, I get the following errors:

*         Cannot resolve directory 'private' / 'referentiel'
*         Cannot resolve file 'listeReferentiels'

It seems that IDEA considers that the view name is related to a path, but in fact it's not (we named definitions like this in case we want to remove Tiles, in which case we only have to add prefix and suffix tags to our viewResolver). Switching from slashes to dots does not work either ("private.referentiel.listeReferentiels").

Do I need a special plugin to support Tiles view resolution (as far as I know, the Struts 1.x plugin only supports Tiles 1)?



Hello Bastien,

indeed Apache Tiles is supported up to version 2.x. Please watch/vote for V3 support here: http://youtrack.jetbrains.com/issue/IDEA-99450

You could try using "old" configurer class (without any guarantee) org.springframework.web.servlet.view.tiles2.TilesConfigurer which will be recognized as configuration point.



Thanks Yann, I will wait for 12.1 then :)


Please sign in to leave a comment.