Problem. The controller action has a rendering tag without passing in the model. There is an action that begins with the word "get".
Grails app / views / site / home.gsp:
homepage
SiteController.groovy:
class SiteController { def index() { render (view: "home") } def getTest() { render "getTest" } }
The site is accessed at localhost: 8080 / site to perform the SiteController index action.
Expected Result: home page Actual Result: getTest home page
If the action of rendering the index changes to this:
render(view: "home", model: [:])
The expected result is displayed.
If a character is added before the word get in the action name, the expected result is returned.
Interestingly, getTest () is color coded as purple in IDEA. It should also be noted that if you have several methods with the word get at the beginning, they ALL are executed.
This did not happen in Grails 1.3.6. This reproduces in the new Grails 2.2.2 project and seems to me a mistake. Why is this happening?
source share