You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The JSP is not rendered and the following error is shown:
Could not resolve view with name '/index/first.jsp' in servlet with name 'grailsDispatcherServlet'
Adding DEBUG level to the log, the following relevant information is shown:
2021-07-08 13:13:18.971 DEBUG --- [nio-8080-exec-2] o.g.w.s.view.GrailsLayoutViewResolver : Resolving view for name /index/first.jsp and locale en
2021-07-08 13:13:18.971 DEBUG --- [nio-8080-exec-2] o.g.w.s.view.GroovyPageViewResolver : Locating GSP view for controller es.salenda.test.entrada.IndexController@2ffd5d39 and path /index/first.jsp
2021-07-08 13:13:18.971 DEBUG --- [nio-8080-exec-2] org.grails.core.io.StaticResourceLoader : Loading resource for path /grails-app/views/index/first.jsp.gsp from base resource URL [file:/Users/miguelangelgarciagomez/Projects/testGrails3.3.9.JSP/]
2021-07-08 13:13:18.971 DEBUG --- [nio-8080-exec-2] org.grails.gsp.GroovyPageResourceLoader : Resolved GSP location [/grails-app/views/index/first.jsp.gsp] to resource [URL [file:/Users/miguelangelgarciagomez/Projects/testGrails3.3.9.JSP/grails-app/views/index/first.jsp.gsp]] (exists? [false]) using base resource [URL [file:/Users/miguelangelgarciagomez/Projects/testGrails3.3.9.JSP/]]
[...]
Where it can be checked that it's trying to obtain the view name first.jsp.gsp, so the suffix .gsp is added.
Digging deeper into the classes involved, it seems that when the method GroovyPagesUriSupport#getAbsoluteViewURIInternal is called, the .gsp suffix is automatically added. I have debugged this method an storing includeSuffix as false, the suffix is not added and it works as expected, and this is the log shown:
2021-07-08 13:18:26.273 DEBUG --- [nio-8080-exec-9] o.g.w.s.view.GroovyPageViewResolver : Locating GSP view for controller es.salenda.test.entrada.IndexController@2ffd5d39 and path /index/first.jsp
2021-07-08 13:18:37.490 DEBUG --- [nio-8080-exec-9] org.grails.core.io.StaticResourceLoader : Loading resource for path /grails-app/views/index/first.jsp from base resource URL [file:/Users/miguelangelgarciagomez/Projects/testGrails3.3.9.JSP/]
2021-07-08 13:18:37.490 DEBUG --- [nio-8080-exec-9] org.grails.core.io.StaticResourceLoader : Found resource for path /grails-app/views/index/first.jsp from base resource URL [file:/Users/miguelangelgarciagomez/Projects/testGrails3.3.9.JSP/]
2021-07-08 13:18:37.490 DEBUG --- [nio-8080-exec-9] org.grails.gsp.GroovyPageResourceLoader : Resolved GSP location [/grails-app/views/index/first.jsp] to resource [URL [file:/Users/miguelangelgarciagomez/Projects/testGrails3.3.9.JSP/grails-app/views/index/first.jsp]] (exists? [true]) using base resource [URL [file:/Users/miguelangelgarciagomez/Projects/testGrails3.3.9.JSP/]]
2021-07-08 13:18:37.490 DEBUG --- [nio-8080-exec-9] o.g.w.s.view.GroovyPageViewResolver : Resolved GSP view at URI [/index/first.jsp]
2021-07-08 13:18:37.491 DEBUG --- [nio-8080-exec-9] o.grails.gsp.compiler.GroovyPageParser : Preprocessing /Users/miguelangelgarciagomez/Projects/testGrails3.3.9.JSP/grails-app/views/index/first.jsp for sitemesh. Replacing head, title, meta and body elements with sitemesh:capture*.
So I'm not sure whether is a configuration that I missed or it's a bug.
Task List
Steps to Reproduce
Expected Behaviour
The JSP should be rendered.
Actual Behaviour
The JSP is not rendered and the following error is shown:
Could not resolve view with name '/index/first.jsp' in servlet with name 'grailsDispatcherServlet'
Adding
DEBUG
level to the log, the following relevant information is shown:Where it can be checked that it's trying to obtain the view name
first.jsp.gsp
, so the suffix.gsp
is added.Digging deeper into the classes involved, it seems that when the method
GroovyPagesUriSupport#getAbsoluteViewURIInternal
is called, the.gsp
suffix is automatically added. I have debugged this method an storingincludeSuffix
as false, the suffix is not added and it works as expected, and this is the log shown:So I'm not sure whether is a configuration that I missed or it's a bug.
Environment Information
Example Application
The text was updated successfully, but these errors were encountered: