23 jan 2012 kl. 15.57 Nicolas LE BAS asked:

The critical piece of information I'm missing is: what is the "current view"? i.e. how are you calling Tiles? Do you get the "current view" concept from your own request attribute, or are you using something like spring's UrlBasedViewResolver?

Yes, I'm using UrlBasedViewResolver this way:
***webmvc-config.xml***
<bean class="org.springframework.web.servlet.view.UrlBasedViewResolver" id="tilesViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.tiles2.TilesView "/>
  </bean>
<bean class="org.springframework.web.servlet.view.tiles2.TilesConfigurer " id="tilesConfigurer">
    <property name="definitions">
      <list>
        <value>/WEB-INF/layouts/layouts.xml</value>
        <value>/WEB-INF/views/**/views.xml</value>
      </list>
    </property>
  </bean>
***

Once you know that, there are easy ways of putting the data into a tiles attribute, and then you can use that attribute in your JSP with <tiles:insertAttribute> or <tiles:importAttribute> as you like.

While I can use attributes in my jspx files, my view resolver is only changing the main content tiles primary and secondary in my earlier sample and the needed changes are in other tiles, ie "header" and also within the head element which is only within my main template "default.jspx".

/MiB




Reply via email to