Skip to content

Tiles2

October 4, 2011
tags:

After you get that working, I have a suggestion. You can use Tiles tags if you include this page directive at the tops of your JSPs:

If you want, this allows you to store your CSS path as an attribute in tiles-defs.xml, and retrieve it from your JSPs with the tag:

<link type="text/css" rel="stylesheet"
href="”/>

========================================================

tiles-defs.xml

<![CDATA[

]]>

Alternatively you can put the content into a separate jsp and then “tiles:insertAttribute” like any other content.

==============================================

one asterisk (*) for a single placeholder;
two asterisks (**) to say “in every directory under the specified one”;

Choose between UrlBasedViewResolver (TilesView + TilesConfigurer) and ResourceBundleViewResolver

=========================

<bean name="myController" class="org.springframework.web.servlet.mvc.UrlFilenameViewController"/>

<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    <property name="mappings">
        <value>
            /**/*.xhtml=myController
        </value>
    </property>
</bean>

Default one is BeanNameUrlHandlerMapping which will only do what you want if you bind your controller bean under the name matching your URI

Advertisements
No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: