I want to render a page in grails without a <html>
, <head>
and <body>
tag, I just want DIV and tables.
I want to integrate this page in my Facebook page and the requirement of Facebook page is that the page should not contain <html>
, <head>
or <body>
tags.
You can use a gsp-template (GSP file name start with '_'). Than you can call you controller an use the render method.
class MyDomainController{
def myAction = {
...
render(template:'myTemplate', model: ...)
}
}
Define a layout that only contains the <g:layoutBody />
tag.
I recommend reviewing Grails Web Layer. Note that if you aren't using layouts then you can simply omit the head and body tags. SiteMesh (and Grails) doesn't care if they are there or not. Another poster recommended a template. If you are using layouts with SiteMesh then it might be easier to simply render a template then write a overriding layout.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With