i am trying to include a jsp, similar to how we include the jsp within jsp by using tag. But couldnt get this working. Tried with the template as well http://grails.1312388.n4.nabble.com/Including-a-jsp-within-a-gsp-td1313927.html
didnt work either.
i am trying to include a jsp, similar to how we include the jsp
Share
In the link you included, Graeme says:
Therefore, you cannot do what you are asking. Why are you trying to mix a JSP in with a GSP? A JSP is just a GSP with less functionality.
My guess is you have an existing JSP with a lot of non-display logic embedded in it. If that’s the case, don’t do that.
JSPs and GSPs are for rendering the view. They should never perform data lookup, or handle complex logic. Those things usually should be handled by services within the controller (or in the controller directly in some cases), or wrapped up in tag libraries if they are part of the display logic.
If you want to include one page in another, you put the file in
grails-app/views/some/path/and name it_myfile.gsp. Then you include it using<g:render template="/some/path/myfile/>. Note that the file must start with an underscore (_), and end with.gsp, but the template reference does not have either.If you have existing JSP tag libraries, you can reuse these in your GSP files, which might help.