Components to Tiles
Migration Path
In Webapps
- Put "tiles.tld" and "tiles.jar" in WEB-INF/
- Replace all reference to 'components.tld' by 'tiles.tld' in *.jsp and *.xml files.
- Replace old package name by new one wherever you use package name (don't forget web.xml and
struts-config.xml)
- s1.struts.components --> org.apache.struts.tiles
- s1.struts.example.component--> org.apache.struts.example.tiles
- s1.struts.taglib.components --> org.apache.struts.taglib.tiles
In Java code
- If some of your java code use or extends old
Components classes, you need to rename imported classes :
- s1.struts.components --> org.apache.struts.tiles
- s1.struts.example.component--> org.apache.struts.example.tiles
- s1.struts.taglib.components --> org.apache.struts.taglib.tiles
Tips
- Jbuilder 5 have a tool called "package migration". You can define your own
set of migration name using previously defined rules.
- Lot of tools (like HomeSite) have extended replace command.
Very old component versions
If you use a very old component version, you also have to change some tags and names :
Deprecated |
New usage |
<include > |
<insert > |
<putAttribute > |
<getAsString > |
<getAttribute > |
<getAsString > |
< instance= >
(in tag <insert > or <include >) |
< definition= >
(in tag <insert >)< |
Default definitions file name :
- componentInstances.xml
- templateDefinitions.xml
|
Several possibilities :
- Keep same name and set it in xml-config.xml:
<init-param>
<param-name>
definitions-config
</param-name>
<param-value>
/WEB-INF/templateDefinitions.xml
</param-value>
</init-param>
- Change name to new default (componentDefinitions.xml)
|
Components parameter names in web.xml:
- instances-config
- instances-debug
|
Use new names :
- definitions-config
- definitions-debug
|
To update your web site, replace all deprecated tags with new tags.
You can use replacement tools to search for :include to be
replaced by :insert