A common thing that one can see in web applications is bread crumbs that help users to locate themself in the application and to navigate. The <layout:crumbs> and <layout:crumb> tags can be used to render bread crumbs.
Display bread crumbs to help users to navigate in the application
The crumbs are actually displays in a panel. Use the crumb tag to set the crumbs.
| Attribute Name | Description |
|---|---|
| styleClass | The css style class to use to render the crumbs panel |
| separator | The character to use to separate the crumbs (default: |) |
| separatorClass | The css style class to use to render the separator. If set, the separator character is not used, but a <div> tag is inserted instead. This allows to have a skinnable image for the separator (the image should be set as the background image of the style class) |
| separatorWidth | Width of the <div> element if used. |
| separatorHeight | Height of the <div> element if used. |
| crumbsName | Name of a bean containing a collection of Crumb in the context |
| crumbsProperty | Property of the bean containing the collection of Crumb. If set and not null, the crumbs in the collection will be displayed, allowing dynamic crumbs |
| bundle | Global bundle to use to retrieve the crumbs messages |
<%@ taglib uri="/WEB-INF/struts-layout.tld" prefix="layout" %> <html> <head> <layout:skin/> </head> <body> Web page Title: crumbs tag example <br><br> <layout:crumbs styleClass="CRUMBS" separator=">"> <layout:crumb key="crumbs.home" link="/index.html"/> <layout:crumb key="crumbs.crumbs" link="/documentation.html"/> <layout:crumb key="crumbs.example"/> </layout:crumbs> <br> Web page content Web page content Web page content Web page content </body> </html>
Note that: