How do I use layouts outside of views?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

How do I use layouts outside of views?

Jeremy Aston
Hi,

I'm new to Sitemesh and although I get the principle of what is  
happening I am struggling to see how to use Sitemesh for layouts for  
general pages.  I am migrating my web site to grails and atm 95% of  
it is static.  I want to use Sitemesh as affectively the templating  
glue to handle all the stuff that is constant over pages such as the  
header/footer etc.

So... for any given page (e.g. apage.gsp) how do I get it to use a  
layout (e.g. alayout.gsp),  I want may pages to be in the root of the  
webapp along side index.jsp.  Sorry to be thick but what must I do?  
The example code so far does not suggest what the file types are for  
the decorated page (e..g html, jsp, gsp) and also they refer to view  
pages - is something different for non view (i.e. essentially static)  
pages?  A quick example would be cool - say how to do pages with  
common header and footers.  I can then expand the current  
documentation once I have my head round it by way of thanks.

Cheers

jez


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: How do I use layouts outside of views?

graemer
Hi jez,

For static pages you can use a meta tag in the header of the HTML;

<meta name="layout" content="main" />

The above will apply the views/layouts/main.gsp page to any page
wether it be a jsp, html or whatever. Sitemesh is a filter that maps
to /* so it operates on all resources within the webapp

Graeme

On 7/20/06, Jeremy Aston <[hidden email]> wrote:

> Hi,
>
> I'm new to Sitemesh and although I get the principle of what is
> happening I am struggling to see how to use Sitemesh for layouts for
> general pages.  I am migrating my web site to grails and atm 95% of
> it is static.  I want to use Sitemesh as affectively the templating
> glue to handle all the stuff that is constant over pages such as the
> header/footer etc.
>
> So... for any given page (e.g. apage.gsp) how do I get it to use a
> layout (e.g. alayout.gsp),  I want may pages to be in the root of the
> webapp along side index.jsp.  Sorry to be thick but what must I do?
> The example code so far does not suggest what the file types are for
> the decorated page (e..g html, jsp, gsp) and also they refer to view
> pages - is something different for non view (i.e. essentially static)
> pages?  A quick example would be cool - say how to do pages with
> common header and footers.  I can then expand the current
> documentation once I have my head round it by way of thanks.
>
> Cheers
>
> jez
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: How do I use layouts outside of views?

Jeremy Aston
Cheers Graeme,

Thats what I thought but doing it with a GSP page in the root of the  
web throws a NPE.  Or am I just being thick :-)

jez


On 20 Jul 2006, at 22:00, Graeme Rocher wrote:

> Hi jez,
>
> For static pages you can use a meta tag in the header of the HTML;
>
> <meta name="layout" content="main" />
>
> The above will apply the views/layouts/main.gsp page to any page
> wether it be a jsp, html or whatever. Sitemesh is a filter that maps
> to /* so it operates on all resources within the webapp
>
> Graeme
>
> On 7/20/06, Jeremy Aston <[hidden email]> wrote:
>> Hi,
>>
>> I'm new to Sitemesh and although I get the principle of what is
>> happening I am struggling to see how to use Sitemesh for layouts for
>> general pages.  I am migrating my web site to grails and atm 95% of
>> it is static.  I want to use Sitemesh as affectively the templating
>> glue to handle all the stuff that is constant over pages such as the
>> header/footer etc.
>>
>> So... for any given page (e.g. apage.gsp) how do I get it to use a
>> layout (e.g. alayout.gsp),  I want may pages to be in the root of the
>> webapp along side index.jsp.  Sorry to be thick but what must I do?
>> The example code so far does not suggest what the file types are for
>> the decorated page (e..g html, jsp, gsp) and also they refer to view
>> pages - is something different for non view (i.e. essentially static)
>> pages?  A quick example would be cool - say how to do pages with
>> common header and footers.  I can then expand the current
>> documentation once I have my head round it by way of thanks.
>>
>> Cheers
>>
>> jez
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: How do I use layouts outside of views?

Jeremy Aston
In reply to this post by graemer
in fact it throws it with an html file as well...


java.lang.NullPointerException at  
org.codehaus.groovy.grails.web.pages.GroovyPagesTemplateEngine
$GroovyPageTemplateWritable.getBinding(GroovyPagesTemplateEngine.java:
433) at org.codehaus.groovy.grails.web.pages.GroovyPagesTemplateEngine
$GroovyPageTemplateWritable.writeTo(GroovyPagesTemplateEngine.java:
392) at org.codehaus.groovy.grails.web.pages.GroovyPagesServlet.doPage
(GroovyPagesServlet.java:149) at  
org.codehaus.groovy.grails.web.pages.GroovyPagesServlet.doGet
(GroovyPagesServlet.java:104) at  
javax.servlet.http.HttpServlet.service(HttpServlet.java:596) at  
javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at  
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
427) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch
(WebApplicationHandler.java:473) at  
org.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:280) at  
org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:171) at  
org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.applyDecorator(
GrailsPageFilter.java:66) at  
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter
(PageFilter.java:62) at  
org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter
(WebApplicationHandler.java:821) at  
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(
CharacterEncodingFilter.java:75) at  
org.springframework.web.filter.OncePerRequestFilter.doFilter
(OncePerRequestFilter.java:76) at  
org.springframework.web.filter.DelegatingFilterProxy.doFilter
(DelegatingFilterProxy.java:137) at  
org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter
(WebApplicationHandler.java:821) at  
org.mortbay.jetty.servlet.WebApplicationHandler.dispatch
(WebApplicationHandler.java:471) at  
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
568) at org.mortbay.http.HttpContext.handle(HttpContext.java:1565) at  
org.mortbay.jetty.servlet.WebApplicationContext.handle
(WebApplicationContext.java:635) at  
org.mortbay.http.HttpContext.handle(HttpContext.java:1517) at  
org.mortbay.http.HttpServer.service(HttpServer.java:954) at  
org.mortbay.http.HttpConnection.service(HttpConnection.java:816) at  
org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:983)  
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833) at  
org.mortbay.http.SocketListener.handleConnection(SocketListener.java:
244) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:
357) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)





On 20 Jul 2006, at 22:00, Graeme Rocher wrote:

> Hi jez,
>
> For static pages you can use a meta tag in the header of the HTML;
>
> <meta name="layout" content="main" />
>
> The above will apply the views/layouts/main.gsp page to any page
> wether it be a jsp, html or whatever. Sitemesh is a filter that maps
> to /* so it operates on all resources within the webapp
>
> Graeme
>
> On 7/20/06, Jeremy Aston <[hidden email]> wrote:
>> Hi,
>>
>> I'm new to Sitemesh and although I get the principle of what is
>> happening I am struggling to see how to use Sitemesh for layouts for
>> general pages.  I am migrating my web site to grails and atm 95% of
>> it is static.  I want to use Sitemesh as affectively the templating
>> glue to handle all the stuff that is constant over pages such as the
>> header/footer etc.
>>
>> So... for any given page (e.g. apage.gsp) how do I get it to use a
>> layout (e.g. alayout.gsp),  I want may pages to be in the root of the
>> webapp along side index.jsp.  Sorry to be thick but what must I do?
>> The example code so far does not suggest what the file types are for
>> the decorated page (e..g html, jsp, gsp) and also they refer to view
>> pages - is something different for non view (i.e. essentially static)
>> pages?  A quick example would be cool - say how to do pages with
>> common header and footers.  I can then expand the current
>> documentation once I have my head round it by way of thanks.
>>
>> Cheers
>>
>> jez
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

fulllogo.gif (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How do I use layouts outside of views?

graemer
Jez,

This was fixed recently before the 0.2 releaes in fact. You don't
appear to be running the latest code. It was this issue:
http://jira.codehaus.org/browse/GRAILS-188

The line numbers in the stack trace don't correspond with the latest code

Graeme

On 7/20/06, Jeremy Aston <[hidden email]> wrote:

> in fact it throws it with an html file as well...
>
>
> java.lang.NullPointerException at
> org.codehaus.groovy.grails.web.pages.GroovyPagesTemplateEngine
> $GroovyPageTemplateWritable.getBinding(GroovyPagesTemplateEngine.java:
> 433) at org.codehaus.groovy.grails.web.pages.GroovyPagesTemplateEngine
> $GroovyPageTemplateWritable.writeTo(GroovyPagesTemplateEngine.java:
> 392) at org.codehaus.groovy.grails.web.pages.GroovyPagesServlet.doPage
> (GroovyPagesServlet.java:149) at
> org.codehaus.groovy.grails.web.pages.GroovyPagesServlet.doGet
> (GroovyPagesServlet.java:104) at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:596) at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
> 427) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch
> (WebApplicationHandler.java:473) at
> org.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:280) at
> org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:171) at
> org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.applyDecorator(
> GrailsPageFilter.java:66) at
> com.opensymphony.module.sitemesh.filter.PageFilter.doFilter
> (PageFilter.java:62) at
> org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter
> (WebApplicationHandler.java:821) at
> org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(
> CharacterEncodingFilter.java:75) at
> org.springframework.web.filter.OncePerRequestFilter.doFilter
> (OncePerRequestFilter.java:76) at
> org.springframework.web.filter.DelegatingFilterProxy.doFilter
> (DelegatingFilterProxy.java:137) at
> org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter
> (WebApplicationHandler.java:821) at
> org.mortbay.jetty.servlet.WebApplicationHandler.dispatch
> (WebApplicationHandler.java:471) at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
> 568) at org.mortbay.http.HttpContext.handle(HttpContext.java:1565) at
> org.mortbay.jetty.servlet.WebApplicationContext.handle
> (WebApplicationContext.java:635) at
> org.mortbay.http.HttpContext.handle(HttpContext.java:1517) at
> org.mortbay.http.HttpServer.service(HttpServer.java:954) at
> org.mortbay.http.HttpConnection.service(HttpConnection.java:816) at
> org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:983)
> at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833) at
> org.mortbay.http.SocketListener.handleConnection(SocketListener.java:
> 244) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:
> 357) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
>
>
>
>
>
>
> On 20 Jul 2006, at 22:00, Graeme Rocher wrote:
>
> > Hi jez,
> >
> > For static pages you can use a meta tag in the header of the HTML;
> >
> > <meta name="layout" content="main" />
> >
> > The above will apply the views/layouts/main.gsp page to any page
> > wether it be a jsp, html or whatever. Sitemesh is a filter that maps
> > to /* so it operates on all resources within the webapp
> >
> > Graeme
> >
> > On 7/20/06, Jeremy Aston <[hidden email]> wrote:
> >> Hi,
> >>
> >> I'm new to Sitemesh and although I get the principle of what is
> >> happening I am struggling to see how to use Sitemesh for layouts for
> >> general pages.  I am migrating my web site to grails and atm 95% of
> >> it is static.  I want to use Sitemesh as affectively the templating
> >> glue to handle all the stuff that is constant over pages such as the
> >> header/footer etc.
> >>
> >> So... for any given page (e.g. apage.gsp) how do I get it to use a
> >> layout (e.g. alayout.gsp),  I want may pages to be in the root of the
> >> webapp along side index.jsp.  Sorry to be thick but what must I do?
> >> The example code so far does not suggest what the file types are for
> >> the decorated page (e..g html, jsp, gsp) and also they refer to view
> >> pages - is something different for non view (i.e. essentially static)
> >> pages?  A quick example would be cool - say how to do pages with
> >> common header and footers.  I can then expand the current
> >> documentation once I have my head round it by way of thanks.
> >>
> >> Cheers
> >>
> >> jez
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe from this list please visit:
> >>
> >>     http://xircles.codehaus.org/manage_email
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list please visit:
> >
> >    http://xircles.codehaus.org/manage_email
> >
> >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: How do I use layouts outside of views?

Jeremy Aston
how bizarre - I do daily updates from SVN and rebuild.....



On 20 Jul 2006, at 22:12, Graeme Rocher wrote:

> Jez,
>
> This was fixed recently before the 0.2 releaes in fact. You don't
> appear to be running the latest code. It was this issue:
> http://jira.codehaus.org/browse/GRAILS-188
>
> The line numbers in the stack trace don't correspond with the  
> latest code
>
> Graeme
>
> On 7/20/06, Jeremy Aston <[hidden email]> wrote:
>> in fact it throws it with an html file as well...
>>
>>
>> java.lang.NullPointerException at
>> org.codehaus.groovy.grails.web.pages.GroovyPagesTemplateEngine
>> $GroovyPageTemplateWritable.getBinding
>> (GroovyPagesTemplateEngine.java:
>> 433) at  
>> org.codehaus.groovy.grails.web.pages.GroovyPagesTemplateEngine
>> $GroovyPageTemplateWritable.writeTo(GroovyPagesTemplateEngine.java:
>> 392) at  
>> org.codehaus.groovy.grails.web.pages.GroovyPagesServlet.doPage
>> (GroovyPagesServlet.java:149) at
>> org.codehaus.groovy.grails.web.pages.GroovyPagesServlet.doGet
>> (GroovyPagesServlet.java:104) at
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:596) at
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at
>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
>> 427) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch
>> (WebApplicationHandler.java:473) at
>> org.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:280) at
>> org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:171) at
>> org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.applyDecorat
>> or(
>> GrailsPageFilter.java:66) at
>> com.opensymphony.module.sitemesh.filter.PageFilter.doFilter
>> (PageFilter.java:62) at
>> org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter
>> (WebApplicationHandler.java:821) at
>> org.springframework.web.filter.CharacterEncodingFilter.doFilterIntern
>> al(
>> CharacterEncodingFilter.java:75) at
>> org.springframework.web.filter.OncePerRequestFilter.doFilter
>> (OncePerRequestFilter.java:76) at
>> org.springframework.web.filter.DelegatingFilterProxy.doFilter
>> (DelegatingFilterProxy.java:137) at
>> org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter
>> (WebApplicationHandler.java:821) at
>> org.mortbay.jetty.servlet.WebApplicationHandler.dispatch
>> (WebApplicationHandler.java:471) at
>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
>> 568) at org.mortbay.http.HttpContext.handle(HttpContext.java:1565) at
>> org.mortbay.jetty.servlet.WebApplicationContext.handle
>> (WebApplicationContext.java:635) at
>> org.mortbay.http.HttpContext.handle(HttpContext.java:1517) at
>> org.mortbay.http.HttpServer.service(HttpServer.java:954) at
>> org.mortbay.http.HttpConnection.service(HttpConnection.java:816) at
>> org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:983)
>> at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833) at
>> org.mortbay.http.SocketListener.handleConnection(SocketListener.java:
>> 244) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:
>> 357) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:
>> 534)
>>
>>
>>
>>
>>
>>
>> On 20 Jul 2006, at 22:00, Graeme Rocher wrote:
>>
>> > Hi jez,
>> >
>> > For static pages you can use a meta tag in the header of the HTML;
>> >
>> > <meta name="layout" content="main" />
>> >
>> > The above will apply the views/layouts/main.gsp page to any page
>> > wether it be a jsp, html or whatever. Sitemesh is a filter that  
>> maps
>> > to /* so it operates on all resources within the webapp
>> >
>> > Graeme
>> >
>> > On 7/20/06, Jeremy Aston <[hidden email]> wrote:
>> >> Hi,
>> >>
>> >> I'm new to Sitemesh and although I get the principle of what is
>> >> happening I am struggling to see how to use Sitemesh for  
>> layouts for
>> >> general pages.  I am migrating my web site to grails and atm  
>> 95% of
>> >> it is static.  I want to use Sitemesh as affectively the  
>> templating
>> >> glue to handle all the stuff that is constant over pages such  
>> as the
>> >> header/footer etc.
>> >>
>> >> So... for any given page (e.g. apage.gsp) how do I get it to use a
>> >> layout (e.g. alayout.gsp),  I want may pages to be in the root  
>> of the
>> >> webapp along side index.jsp.  Sorry to be thick but what must I  
>> do?
>> >> The example code so far does not suggest what the file types  
>> are for
>> >> the decorated page (e..g html, jsp, gsp) and also they refer to  
>> view
>> >> pages - is something different for non view (i.e. essentially  
>> static)
>> >> pages?  A quick example would be cool - say how to do pages with
>> >> common header and footers.  I can then expand the current
>> >> documentation once I have my head round it by way of thanks.
>> >>
>> >> Cheers
>> >>
>> >> jez
>> >>
>> >>
>> >>  
>> ---------------------------------------------------------------------
>> >> To unsubscribe from this list please visit:
>> >>
>> >>     http://xircles.codehaus.org/manage_email
>> >>
>> >>
>> >
>> >  
>> ---------------------------------------------------------------------
>> > To unsubscribe from this list please visit:
>> >
>> >    http://xircles.codehaus.org/manage_email
>> >
>> >
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: How do I use layouts outside of views?

Jeremy Aston
In reply to this post by graemer
and grails init ;-)


On 20 Jul 2006, at 22:12, Graeme Rocher wrote:

> Jez,
>
> This was fixed recently before the 0.2 releaes in fact. You don't
> appear to be running the latest code. It was this issue:
> http://jira.codehaus.org/browse/GRAILS-188
>
> The line numbers in the stack trace don't correspond with the  
> latest code
>
> Graeme
>
> On 7/20/06, Jeremy Aston <[hidden email]> wrote:
>> in fact it throws it with an html file as well...
>>
>>
>> java.lang.NullPointerException at
>> org.codehaus.groovy.grails.web.pages.GroovyPagesTemplateEngine
>> $GroovyPageTemplateWritable.getBinding
>> (GroovyPagesTemplateEngine.java:
>> 433) at  
>> org.codehaus.groovy.grails.web.pages.GroovyPagesTemplateEngine
>> $GroovyPageTemplateWritable.writeTo(GroovyPagesTemplateEngine.java:
>> 392) at  
>> org.codehaus.groovy.grails.web.pages.GroovyPagesServlet.doPage
>> (GroovyPagesServlet.java:149) at
>> org.codehaus.groovy.grails.web.pages.GroovyPagesServlet.doGet
>> (GroovyPagesServlet.java:104) at
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:596) at
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at
>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
>> 427) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch
>> (WebApplicationHandler.java:473) at
>> org.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:280) at
>> org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:171) at
>> org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.applyDecorat
>> or(
>> GrailsPageFilter.java:66) at
>> com.opensymphony.module.sitemesh.filter.PageFilter.doFilter
>> (PageFilter.java:62) at
>> org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter
>> (WebApplicationHandler.java:821) at
>> org.springframework.web.filter.CharacterEncodingFilter.doFilterIntern
>> al(
>> CharacterEncodingFilter.java:75) at
>> org.springframework.web.filter.OncePerRequestFilter.doFilter
>> (OncePerRequestFilter.java:76) at
>> org.springframework.web.filter.DelegatingFilterProxy.doFilter
>> (DelegatingFilterProxy.java:137) at
>> org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter
>> (WebApplicationHandler.java:821) at
>> org.mortbay.jetty.servlet.WebApplicationHandler.dispatch
>> (WebApplicationHandler.java:471) at
>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
>> 568) at org.mortbay.http.HttpContext.handle(HttpContext.java:1565) at
>> org.mortbay.jetty.servlet.WebApplicationContext.handle
>> (WebApplicationContext.java:635) at
>> org.mortbay.http.HttpContext.handle(HttpContext.java:1517) at
>> org.mortbay.http.HttpServer.service(HttpServer.java:954) at
>> org.mortbay.http.HttpConnection.service(HttpConnection.java:816) at
>> org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:983)
>> at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833) at
>> org.mortbay.http.SocketListener.handleConnection(SocketListener.java:
>> 244) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:
>> 357) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:
>> 534)
>>
>>
>>
>>
>>
>>
>> On 20 Jul 2006, at 22:00, Graeme Rocher wrote:
>>
>> > Hi jez,
>> >
>> > For static pages you can use a meta tag in the header of the HTML;
>> >
>> > <meta name="layout" content="main" />
>> >
>> > The above will apply the views/layouts/main.gsp page to any page
>> > wether it be a jsp, html or whatever. Sitemesh is a filter that  
>> maps
>> > to /* so it operates on all resources within the webapp
>> >
>> > Graeme
>> >
>> > On 7/20/06, Jeremy Aston <[hidden email]> wrote:
>> >> Hi,
>> >>
>> >> I'm new to Sitemesh and although I get the principle of what is
>> >> happening I am struggling to see how to use Sitemesh for  
>> layouts for
>> >> general pages.  I am migrating my web site to grails and atm  
>> 95% of
>> >> it is static.  I want to use Sitemesh as affectively the  
>> templating
>> >> glue to handle all the stuff that is constant over pages such  
>> as the
>> >> header/footer etc.
>> >>
>> >> So... for any given page (e.g. apage.gsp) how do I get it to use a
>> >> layout (e.g. alayout.gsp),  I want may pages to be in the root  
>> of the
>> >> webapp along side index.jsp.  Sorry to be thick but what must I  
>> do?
>> >> The example code so far does not suggest what the file types  
>> are for
>> >> the decorated page (e..g html, jsp, gsp) and also they refer to  
>> view
>> >> pages - is something different for non view (i.e. essentially  
>> static)
>> >> pages?  A quick example would be cool - say how to do pages with
>> >> common header and footers.  I can then expand the current
>> >> documentation once I have my head round it by way of thanks.
>> >>
>> >> Cheers
>> >>
>> >> jez
>> >>
>> >>
>> >>  
>> ---------------------------------------------------------------------
>> >> To unsubscribe from this list please visit:
>> >>
>> >>     http://xircles.codehaus.org/manage_email
>> >>
>> >>
>> >
>> >  
>> ---------------------------------------------------------------------
>> > To unsubscribe from this list please visit:
>> >
>> >    http://xircles.codehaus.org/manage_email
>> >
>> >
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: How do I use layouts outside of views?

graemer
You may have a conflicting jar in your grails app try

grails clean run-app

Graeme

On 7/20/06, Jeremy Aston <[hidden email]> wrote:

> and grails init ;-)
>
>
> On 20 Jul 2006, at 22:12, Graeme Rocher wrote:
>
> > Jez,
> >
> > This was fixed recently before the 0.2 releaes in fact. You don't
> > appear to be running the latest code. It was this issue:
> > http://jira.codehaus.org/browse/GRAILS-188
> >
> > The line numbers in the stack trace don't correspond with the
> > latest code
> >
> > Graeme
> >
> > On 7/20/06, Jeremy Aston <[hidden email]> wrote:
> >> in fact it throws it with an html file as well...
> >>
> >>
> >> java.lang.NullPointerException at
> >> org.codehaus.groovy.grails.web.pages.GroovyPagesTemplateEngine
> >> $GroovyPageTemplateWritable.getBinding
> >> (GroovyPagesTemplateEngine.java:
> >> 433) at
> >> org.codehaus.groovy.grails.web.pages.GroovyPagesTemplateEngine
> >> $GroovyPageTemplateWritable.writeTo(GroovyPagesTemplateEngine.java:
> >> 392) at
> >> org.codehaus.groovy.grails.web.pages.GroovyPagesServlet.doPage
> >> (GroovyPagesServlet.java:149) at
> >> org.codehaus.groovy.grails.web.pages.GroovyPagesServlet.doGet
> >> (GroovyPagesServlet.java:104) at
> >> javax.servlet.http.HttpServlet.service(HttpServlet.java:596) at
> >> javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at
> >> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
> >> 427) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch
> >> (WebApplicationHandler.java:473) at
> >> org.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:280) at
> >> org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:171) at
> >> org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.applyDecorat
> >> or(
> >> GrailsPageFilter.java:66) at
> >> com.opensymphony.module.sitemesh.filter.PageFilter.doFilter
> >> (PageFilter.java:62) at
> >> org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter
> >> (WebApplicationHandler.java:821) at
> >> org.springframework.web.filter.CharacterEncodingFilter.doFilterIntern
> >> al(
> >> CharacterEncodingFilter.java:75) at
> >> org.springframework.web.filter.OncePerRequestFilter.doFilter
> >> (OncePerRequestFilter.java:76) at
> >> org.springframework.web.filter.DelegatingFilterProxy.doFilter
> >> (DelegatingFilterProxy.java:137) at
> >> org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter
> >> (WebApplicationHandler.java:821) at
> >> org.mortbay.jetty.servlet.WebApplicationHandler.dispatch
> >> (WebApplicationHandler.java:471) at
> >> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
> >> 568) at org.mortbay.http.HttpContext.handle(HttpContext.java:1565) at
> >> org.mortbay.jetty.servlet.WebApplicationContext.handle
> >> (WebApplicationContext.java:635) at
> >> org.mortbay.http.HttpContext.handle(HttpContext.java:1517) at
> >> org.mortbay.http.HttpServer.service(HttpServer.java:954) at
> >> org.mortbay.http.HttpConnection.service(HttpConnection.java:816) at
> >> org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:983)
> >> at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833) at
> >> org.mortbay.http.SocketListener.handleConnection(SocketListener.java:
> >> 244) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:
> >> 357) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:
> >> 534)
> >>
> >>
> >>
> >>
> >>
> >>
> >> On 20 Jul 2006, at 22:00, Graeme Rocher wrote:
> >>
> >> > Hi jez,
> >> >
> >> > For static pages you can use a meta tag in the header of the HTML;
> >> >
> >> > <meta name="layout" content="main" />
> >> >
> >> > The above will apply the views/layouts/main.gsp page to any page
> >> > wether it be a jsp, html or whatever. Sitemesh is a filter that
> >> maps
> >> > to /* so it operates on all resources within the webapp
> >> >
> >> > Graeme
> >> >
> >> > On 7/20/06, Jeremy Aston <[hidden email]> wrote:
> >> >> Hi,
> >> >>
> >> >> I'm new to Sitemesh and although I get the principle of what is
> >> >> happening I am struggling to see how to use Sitemesh for
> >> layouts for
> >> >> general pages.  I am migrating my web site to grails and atm
> >> 95% of
> >> >> it is static.  I want to use Sitemesh as affectively the
> >> templating
> >> >> glue to handle all the stuff that is constant over pages such
> >> as the
> >> >> header/footer etc.
> >> >>
> >> >> So... for any given page (e.g. apage.gsp) how do I get it to use a
> >> >> layout (e.g. alayout.gsp),  I want may pages to be in the root
> >> of the
> >> >> webapp along side index.jsp.  Sorry to be thick but what must I
> >> do?
> >> >> The example code so far does not suggest what the file types
> >> are for
> >> >> the decorated page (e..g html, jsp, gsp) and also they refer to
> >> view
> >> >> pages - is something different for non view (i.e. essentially
> >> static)
> >> >> pages?  A quick example would be cool - say how to do pages with
> >> >> common header and footers.  I can then expand the current
> >> >> documentation once I have my head round it by way of thanks.
> >> >>
> >> >> Cheers
> >> >>
> >> >> jez
> >> >>
> >> >>
> >> >>
> >> ---------------------------------------------------------------------
> >> >> To unsubscribe from this list please visit:
> >> >>
> >> >>     http://xircles.codehaus.org/manage_email
> >> >>
> >> >>
> >> >
> >> >
> >> ---------------------------------------------------------------------
> >> > To unsubscribe from this list please visit:
> >> >
> >> >    http://xircles.codehaus.org/manage_email
> >> >
> >> >
> >>
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe from this list please visit:
> >>
> >>     http://xircles.codehaus.org/manage_email
> >>
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list please visit:
> >
> >    http://xircles.codehaus.org/manage_email
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: How do I use layouts outside of views?

Jeremy Aston
yup - a complete clean of everything seemed to work.  cheers


On 20 Jul 2006, at 22:32, Graeme Rocher wrote:

> You may have a conflicting jar in your grails app try
>
> grails clean run-app
>
> Graeme
>
> On 7/20/06, Jeremy Aston <[hidden email]> wrote:
>> and grails init ;-)
>>
>>
>> On 20 Jul 2006, at 22:12, Graeme Rocher wrote:
>>
>> > Jez,
>> >
>> > This was fixed recently before the 0.2 releaes in fact. You don't
>> > appear to be running the latest code. It was this issue:
>> > http://jira.codehaus.org/browse/GRAILS-188
>> >
>> > The line numbers in the stack trace don't correspond with the
>> > latest code
>> >
>> > Graeme
>> >
>> > On 7/20/06, Jeremy Aston <[hidden email]> wrote:
>> >> in fact it throws it with an html file as well...
>> >>
>> >>
>> >> java.lang.NullPointerException at
>> >> org.codehaus.groovy.grails.web.pages.GroovyPagesTemplateEngine
>> >> $GroovyPageTemplateWritable.getBinding
>> >> (GroovyPagesTemplateEngine.java:
>> >> 433) at
>> >> org.codehaus.groovy.grails.web.pages.GroovyPagesTemplateEngine
>> >> $GroovyPageTemplateWritable.writeTo
>> (GroovyPagesTemplateEngine.java:
>> >> 392) at
>> >> org.codehaus.groovy.grails.web.pages.GroovyPagesServlet.doPage
>> >> (GroovyPagesServlet.java:149) at
>> >> org.codehaus.groovy.grails.web.pages.GroovyPagesServlet.doGet
>> >> (GroovyPagesServlet.java:104) at
>> >> javax.servlet.http.HttpServlet.service(HttpServlet.java:596) at
>> >> javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at
>> >> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
>> >> 427) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch
>> >> (WebApplicationHandler.java:473) at
>> >> org.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:
>> 280) at
>> >> org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:
>> 171) at
>> >>  
>> org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.applyDecorat
>> >> or(
>> >> GrailsPageFilter.java:66) at
>> >> com.opensymphony.module.sitemesh.filter.PageFilter.doFilter
>> >> (PageFilter.java:62) at
>> >> org.mortbay.jetty.servlet.WebApplicationHandler
>> $CachedChain.doFilter
>> >> (WebApplicationHandler.java:821) at
>> >>  
>> org.springframework.web.filter.CharacterEncodingFilter.doFilterIntern
>> >> al(
>> >> CharacterEncodingFilter.java:75) at
>> >> org.springframework.web.filter.OncePerRequestFilter.doFilter
>> >> (OncePerRequestFilter.java:76) at
>> >> org.springframework.web.filter.DelegatingFilterProxy.doFilter
>> >> (DelegatingFilterProxy.java:137) at
>> >> org.mortbay.jetty.servlet.WebApplicationHandler
>> $CachedChain.doFilter
>> >> (WebApplicationHandler.java:821) at
>> >> org.mortbay.jetty.servlet.WebApplicationHandler.dispatch
>> >> (WebApplicationHandler.java:471) at
>> >> org.mortbay.jetty.servlet.ServletHandler.handle
>> (ServletHandler.java:
>> >> 568) at org.mortbay.http.HttpContext.handle(HttpContext.java:
>> 1565) at
>> >> org.mortbay.jetty.servlet.WebApplicationContext.handle
>> >> (WebApplicationContext.java:635) at
>> >> org.mortbay.http.HttpContext.handle(HttpContext.java:1517) at
>> >> org.mortbay.http.HttpServer.service(HttpServer.java:954) at
>> >> org.mortbay.http.HttpConnection.service(HttpConnection.java:
>> 816) at
>> >> org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:
>> 983)
>> >> at org.mortbay.http.HttpConnection.handle(HttpConnection.java:
>> 833) at
>> >> org.mortbay.http.SocketListener.handleConnection
>> (SocketListener.java:
>> >> 244) at org.mortbay.util.ThreadedServer.handle
>> (ThreadedServer.java:
>> >> 357) at org.mortbay.util.ThreadPool$PoolThread.run
>> (ThreadPool.java:
>> >> 534)
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> On 20 Jul 2006, at 22:00, Graeme Rocher wrote:
>> >>
>> >> > Hi jez,
>> >> >
>> >> > For static pages you can use a meta tag in the header of the  
>> HTML;
>> >> >
>> >> > <meta name="layout" content="main" />
>> >> >
>> >> > The above will apply the views/layouts/main.gsp page to any page
>> >> > wether it be a jsp, html or whatever. Sitemesh is a filter that
>> >> maps
>> >> > to /* so it operates on all resources within the webapp
>> >> >
>> >> > Graeme
>> >> >
>> >> > On 7/20/06, Jeremy Aston <[hidden email]> wrote:
>> >> >> Hi,
>> >> >>
>> >> >> I'm new to Sitemesh and although I get the principle of what is
>> >> >> happening I am struggling to see how to use Sitemesh for
>> >> layouts for
>> >> >> general pages.  I am migrating my web site to grails and atm
>> >> 95% of
>> >> >> it is static.  I want to use Sitemesh as affectively the
>> >> templating
>> >> >> glue to handle all the stuff that is constant over pages such
>> >> as the
>> >> >> header/footer etc.
>> >> >>
>> >> >> So... for any given page (e.g. apage.gsp) how do I get it to  
>> use a
>> >> >> layout (e.g. alayout.gsp),  I want may pages to be in the root
>> >> of the
>> >> >> webapp along side index.jsp.  Sorry to be thick but what must I
>> >> do?
>> >> >> The example code so far does not suggest what the file types
>> >> are for
>> >> >> the decorated page (e..g html, jsp, gsp) and also they refer to
>> >> view
>> >> >> pages - is something different for non view (i.e. essentially
>> >> static)
>> >> >> pages?  A quick example would be cool - say how to do pages  
>> with
>> >> >> common header and footers.  I can then expand the current
>> >> >> documentation once I have my head round it by way of thanks.
>> >> >>
>> >> >> Cheers
>> >> >>
>> >> >> jez
>> >> >>
>> >> >>
>> >> >>
>> >>  
>> ---------------------------------------------------------------------
>> >> >> To unsubscribe from this list please visit:
>> >> >>
>> >> >>     http://xircles.codehaus.org/manage_email
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>  
>> ---------------------------------------------------------------------
>> >> > To unsubscribe from this list please visit:
>> >> >
>> >> >    http://xircles.codehaus.org/manage_email
>> >> >
>> >> >
>> >>
>> >>
>> >>
>> >>
>> >>  
>> ---------------------------------------------------------------------
>> >> To unsubscribe from this list please visit:
>> >>
>> >>     http://xircles.codehaus.org/manage_email
>> >>
>> >>
>> >>
>> >
>> >  
>> ---------------------------------------------------------------------
>> > To unsubscribe from this list please visit:
>> >
>> >    http://xircles.codehaus.org/manage_email
>> >
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email