RE: Having difficultly getting started wi th sitemesh & spring mvc

"Smiley, Stuart A." <[email protected]> Thu, 22 Sep 2005 13:05:48 -0400
Newsgroups gmane.comp.web.sitemesh.general,gmane.comp.lang.pnuts.user
Message-ID <71BD1AD1D6DAF5488C97EF358746AAA422E323@vie-its-exs01.mail.saic.com>
I might be using a different configuration, but I have a sitemesh.xml file
in WEB-INF also that defines where decorators.xml is, what the excludes are,
page-parsers, and decorator-mappers.  Are you sure you shouldn't have a
sitemesh.xml file also?

Stuart

-----Original Message-----
From: [email protected]
[mailto:[email protected]
]On Behalf Of Richard Osbaldeston
Sent: Thursday, September 22, 2005 12:48 PM
To: [email protected]
Subject: [Opensymphony-sitemesh] Having difficultly getting started with
sitemesh &#38; spring mvc


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#156
29


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]