Calling a Grails GSP from 2 different controllers -
I have GSP that will be sung from a FizzController
, but it has JavaScript code which needs it To send AJAX calls back to BuzzController
.
My current project directory structure:
myapp / grails-app controller / myapp / FizzController Groovy BuzzController.groovy Ideas / Fiz / Menpage. Gsp buzz / buzz.gsp & Lt; General grails-app dir> General directory structure for Grails app src / web-app / & lt; & Gt;
GSP:
DIF index () {render (see: "discussion") to FizzController # index
method when I Run it and go to http: // localhost: 8080 / myapp / fizz
, I hope it presents it to my GSP. Instead I'm getting a custom "Page Not Found" page. Nothing in the Application log Any ideas about what's happening here?
render
is not the parameter parameter controller
Then you need to use something like this:
Render view: '/ buzz / buzz', model: fetchAndInjectModel ()
Docs :
Other options do a redirect:
Redirect (Controller: "buzz", verb: "buzz")
Comments
Post a Comment