複数のデコレータが必要です。詳しくは、https://github.com/sitemesh/sitemesh2を参照してください。私はdecorators.xmlに複数のデコレータを用意していますが、メインデコレータはプロジェクトのすべてのファイルに適用されます。 など。複数のデコレータファイルを含むsitemesh
<decorators defaultdir="/WEB-INF/decorators">
<decorator name="main" page="main.jspx">
<pattern>/*</pattern>
</decorator>
<decorator name="other" page="other.jspx">
<pattern>/spring/other/*</pattern>
</decorator>
</decorators>
両方/spring/some/page.jspx
と/spring/other/page.jspx
両方 `main.jspx」テンプレートを使用してレンダリング:私のデコレータはこのようになります。
私は間違っていますか?
これは機能しませんでした。実際に私はたくさんのものを試してきましたが、どのテンプレートでも動作するのは '/ *'または '/ context *'だけです。例えば '/ context/x/* 'のようなパターンは適用されません。 – Kevin