Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render template with relative paths work in dev but not in prod #351

Open
ppazos opened this issue Jun 20, 2023 · 0 comments
Open

Render template with relative paths work in dev but not in prod #351

ppazos opened this issue Jun 20, 2023 · 0 comments

Comments

@ppazos
Copy link

ppazos commented Jun 20, 2023

A view uses a template that is on a different folder (that part is reused by many other views).

Steps to Reproduce

This worked in prod and in dev in Grails 3.x

<g:render template="./../version/versionRow" model="[version:version]"/>

In Grails 5.x dev that works, but in prod that doesn't work:

org.grails.taglib.GrailsTagException: [views/versionedActor/show.gsp:101] Template not found for name [../version/versionRow] and path [/_version/versionRow.gsp]
	at org.grails.gsp.GroovyPage.throwRootCause(GroovyPage.java:469)
	at org.grails.gsp.GroovyPage.invokeTag(GroovyPage.java:415)
	at jdk.internal.reflect.GeneratedMethodAccessor641.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:362)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:61)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:171)
	at gsp_EHRServerNG_versionedActorshow_gsp$_run_closure2.doCall(gsp_EHRServerNG_versionedActorshow_gsp.groovy:53)

In Grails 5.x prod this works: (this is correctly documented as / will be resolved against the views folder)

<g:render template="/version/versionRow" model="[version:version]"/>

What I think is inconsistent is that in dev it works and not in prod. In fact I detected the issue in prod which is not ideal.

Expected Behaviour

Just to have a consistent dev and prod behavior.

Actual Behaviour

Inconsistent dev and prod behavior.

Environment Information

  • Operating System: Linux Mint
  • Grails Version: 5.3.2
  • JDK Version: 11.0.10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant