Skip to content

Commit

Permalink
Basic configuration documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
codeconsole committed Nov 4, 2023
1 parent 64511ea commit 1872f3c
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions CONFIGURATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# XML Configuration Defaults

The following is `/WEB-INF/sitemesh3.xml` file that shows default settings that may be overriden. These settings are not required because this configuration is demonstrating what the default setting is and what you would change if you would prefer something else.
```xml
<sitemesh>
<decorator-selector>org.sitemesh.config.MetaTagBasedDecoratorSelector</decorator-selector>
<decorator-prefix>/WEB-INF/decorators/</decorator-prefix>
<include-error-pages>true</include-error-pages>
</sitemesh>
```

Decorator Mapping Support
```xml
<sitemesh>
<mapping path="/*" decorator="default.html"/>
<mapping path="/Pretty/*" decorator="bootstrap.jsp"/>
<mapping path="/assets/*" exclude="true" />
</sitemesh>
```

| Option | Description |
|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| decorator-selector | The Decorator Selector to be used. This controls how decorators are applied to content. This can be done based on path, meta tags, request attributes, etc. Examples include `MetaTagBasedDecoratorSelector`, `PathBasedDecoratorSelector`, `RequestAttributeDecoratorSelector`. The default is `MetaTagBasedDecoratorSelector` |
| decorator-prefix | The default prefix/location of decorators. You can set this to blank `""` if you wish to have decorators in more than one location. The default value is `/WEB-INF/decorators/` |
| include-error-pages | If an error occurs inside a decorator, should the error page be shown or ignored. This is only the behavior for errors that happen inside a decorator. The default is value is `true` |
| mapping | Specifies a PathBasedDecoratorSelector mapping using a `path` and (`decorator` or `exclude`) attributes. Use `decorator` if you want to apply the specified decorator to that path or `exclude` if you want that path excluded from decoration. |

0 comments on commit 1872f3c

Please sign in to comment.