0

I would like to have a snippet html loaded in the action method of a controller. Is there a way to do this?

What I want to accomplish is actually have the Controller action use json as the format to return my response (with error codes and other information) and include a snippet of html loaded from a template file as one part of the json response.

My response would be something like:

{
errCode: 200,
myHtml: "Some html portion loaded from a template file goes here"

... more data elements..
}

The action would return the response with 'render (contentType: "text/json", data);

1 Answer 1

1

You mean like this: http://mrhaki.blogspot.com/2010/05/grails-goodness-use-gsp-template-engine.html

It's hard to see which bit you need help with from your question

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.