Reputation: 41
I added compile "org.grails:grails-plugin-gsp"
to a grails 3 project created under rest-api profile so I could return an HTML view with the API documentation. I created the index.gsp file, made the war, run the app and got this error
ERROR --- [nio-8080-exec-5] .a.c.c.C.[.[.[.[grailsDispatcherServlet] : Servlet.service() for servlet [grailsDispatcherServlet] in context with path [/catalog] threw exception [Could not resolve view with name '/index' in servlet with name 'grailsDispatcherServlet'] with root cause
javax.servlet.ServletException: Could not resolve view with name '/index' in servlet with name 'grailsDispatcherServlet'
I assume that the error is that the gsp was not compiled, because on the console when I run gradle war
I see
:processResources
:classes
:compileGsonViews
:war
Is that the error? Can I add somehow the compile gsp task to the war task? Thanks!
Upvotes: 2
Views: 440
Reputation: 41
Seems that adding apply plugin:"org.grails.grails-gsp"
to build.gradle
file (apart from adding the dependency) does the trick.
Upvotes: 2