Having difficultly getting started with sitemesh & spring mvc
Richard Osbaldeston <[email protected]> Thu, 22 Sep 2005 11:48:22 CDT
| Newsgroups | gmane.comp.web.sitemesh.general,gmane.comp.lang.pnuts.user |
|---|---|
| Message-ID | <32190581.1127407766448.JavaMail.os-j2ee@opensymphony01.contegix.com> |
Just trying to add Sitemesh into an exiting Spring MVC app and not having a fun time getting things working. At the moment I'm not trying to do anything exciting, just decorating the index page would be a start. I've got sitemesh and the filter installed and running, but whats happening is I get a blank page of zero length as a result every time. Been banging my head against this for a couple of hours now and I just can't see whats going wrong.
My web.xml filters are setup like this:
<filter>
<filter-name>hibernateFilter</filter-name>
<filter-class>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
</filter-class>
<init-param>
<param-name>singleSession</param-name>
<param-value>false</param-value>
</init-param>
</filter>
<filter>
<filter-name>sitemesh</filter-name>
<filter-class>
com.opensymphony.module.sitemesh.filter.PageFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>hibernateFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
decorators.xml:
<?xml version="1.0"?>
<!DOCTYPE decorators PUBLIC
"-//OpenSymphony//SiteMesh 1.5 Decorators//EN"
"http://www.opensymphony.com/sitemesh/dtd/sitemesh_1_5_decorators.dtd">
<decorators defaultdir="/decorators">
<decorator name="main" page="main.jsp">
<pattern>*</pattern>
</decorator>
</decorators>
and decorators/main.jsp just a copy of the demo one:
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %>
<html>
<head>
<title>My Site - <decorator:title default="Welcome!"/></title>
<decorator:head/>
</head>
<body>
<decorator:body/>
</body>
</html>
I've tried an retried every combination of filter and decorator mappings, including just the wildcards for everything - every time sitemesh kicks in I get this blank page and no error messages.. the spring controllers are mapped to *.do, with the above configuration they will pass through sitemesh and render OK. Using spring 1.2.4, sitemesh 1.2.1, tomcat 5.0.28 all on windows xp and sun jdk 1.4.2.07.. Is their any way to get some debugging information? tried stepping though the PageFilter and its picking up the main.jsp decorator and calling applyDecorator() but nothing ever appears?
Sorely confused,
- Richard
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=7033&messageID=15629#15629
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]