Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

sitemesh and css problem

843840Nov 1 2008 — edited Nov 1 2008
Hi. I want to use SiteMesh to decorate various pages (jsp, html). I have a decorator, but i can't seem to link a css sheet to my pages.

I have decorators.xml in /WEB-INF/
<?xml version="1.0" encoding="ISO-8859-1"?>
<decorators defaultdir="/WEB-INF/decorators">
<decorator name="main" page="main.jsp">
<pattern>/*</pattern>
</decorator>
</decorators>

I have main.jsp in /WEB-INF/decorators/
<%@ taglib prefix="decorator" uri="http://www.opensymphony.com/sitemeshdecorator" %>
<head>
<title>
<decorator:title default="Java Tutorial" />
</title>
<link href="*/decorators/main.css*" rel="stylesheet" type="text/css"> //here I also tried href="<%= request.getContextPath() %>/decorators/main.css", but it //also does'n work
<decorator:head />
<body>
<decorator:body />
</body>
</html>

and I have main.css in /WEB-INF/decorators/
but when I run the application it displays everything except for the stylesheet elements. Any idea what I'm doing wrong?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 29 2008
Added on Nov 1 2008
4 comments
892 views