【发布时间】:2013-03-01 16:50:11
【问题描述】:
我的问候!
问题很简短:有没有办法在运行时更改装饰器?例如,我有一个带有一些“装饰器样式”的下拉菜单,所以当用户选择不同的样式时,它会更改装饰器。
如果您对此主题有任何有用的链接,我将不胜感激。
找到了这个帖子 - SiteMesh: Changing the content-type of the response - 但仍然没有帮助。
【问题讨论】:
我的问候!
问题很简短:有没有办法在运行时更改装饰器?例如,我有一个带有一些“装饰器样式”的下拉菜单,所以当用户选择不同的样式时,它会更改装饰器。
如果您对此主题有任何有用的链接,我将不胜感激。
找到了这个帖子 - SiteMesh: Changing the content-type of the response - 但仍然没有帮助。
【问题讨论】:
我知道您可以使用meta HTML 标记来指定您希望在 JSP 文件中使用的装饰器。例如在文件login.jsp 中我需要login 装饰器:
<head>
<meta name="decorator" content="login" />
<!-- where "login" is the name of the decorator -->
</head>
所以,我还没有尝试过,但您可能可以通过 POST 或 GET 参数给出装饰器的名称,并在 meta 标记中使用它:
<meta name="decorator" content="${decoratorName}" />
【讨论】: