Using Tiles with Spring MVC


/ Published in: Java
Save to your folder(s)

The way to tell Spring MVC to resolve logic view names to Tiles "definition" name is, in a DispatcherServlet configuration file, define a bean of type UrlBasedViewResolver with viewClass org.springframework.web.servlet.view.tiles2.TilesView


Copy this code and paste it in your HTML
  1. <bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
  2. <property name="contentType" value="text/html;charset=utf-8"/>
  3. <property name="order" value="10"/>
  4. <property name="requestContextAttribute" value="requestContext"/>
  5. <property name="viewClass" value="org.springframework.web.servlet.view.tiles2.TilesView"/>
  6. </bean>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.