gpt4 book ai didi

Grails GSP 编译?

转载 作者:行者123 更新时间:2023-12-04 10:05:30 26 4
gpt4 key购买 nike

当您编译 grails war 时,我知道 .groovy 代码被编译为字节码类文件,但我不明白容器(例如 tomcat)如何在请求 GSP 时知道如何编译它们。容器了解 GSP 吗?安装在服务器上的 grails 是否与容器 Hook ?

此外,当第一次使用 GSP 时,它会根据需要编译一次,并且只编译一次。这样对吗?谢谢。

最佳答案

Do the containers understand GSP?



GSP实际上是在构建war时编译成类文件的,而不是在运行时被tomcat编译——如果你解压war文件,你可以看看它做了什么(看看解压后的WEB-INF/classes目录):
...
gsp_appname_controllerNameviewName_gsp.class
gsp_appname_controllerNameanotherViewName_gsp.class
...

容器在运行时不需要做任何事情,因为一切都是预编译的。

Does the fact that grails is installed on the server hook into the containers?



它不是;应用程序运行所需的一切都包含在 war 中,因此安装在容器服务器上的 grails 没有任何区别。

关于Grails GSP 编译?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6763298/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com