Re: Different decorator for different paths
Jeff <[email protected]> Mon, 04 Dec 2006 12:45:23 CST
| Newsgroups | gmane.comp.web.sitemesh.general |
|---|---|
| Message-ID | <22736228.1165257954242.JavaMail.os-j2ee@opensymphony01.managed.contegix.com> |
Hey Richard,
I've been tearing my hair out on this for a while, but I think I've finally got it.
<decorator name="admin" page="admin.jsp">
<pattern>/admin*</pattern>
</decorator>
<decorator name="report" page="report.jsp">
<pattern>/report*</pattern>
</decorator>
I think you may need to take out those slashes. Since sitemesh seems to have almost no log output anywhere I had to get into the source and I finally found what it's using for the mapping lookup.
public Decorator getDecorator(HttpServletRequest request, Page page) {
String thisPath = request.getServletPath();
For something like /report/foo.html this returns "/report" not "/report/"
Hope that helps you. I was about to toss this stuff in the garbage.
-j
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=48405&messageID=105115#105115
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]