我可以有一个名为Office365Controller的grails Controller 吗?更具体地说,是否允许在 Controller 名称中包含数字?在网址映射中,我使用office365作为 Controller 。这是否可能与用于 Controller 的 Camel 套惯例冲突。
我问这个问题,因为当我在此 Controller 内调用函数时,出现tomcat错误403。我的所有其他 Controller 都工作正常,并且所有 Controller 的安全性相同。
最佳答案
Can I have a grails controller named Office365Controller.
是。
More specifically is it allowed to have numbers in controller names?
是。
I ask this question because when i call a function inside this controller, i get tomcat error 403.
您的应用中可能还有其他因素导致了此问题,但是我认为 Controller 名称中的数字不会导致403。像这样的 Controller 应该可以正常工作:
class Office365Controller {
def index() {
render retrieveSomeValue()
}
protected retrieveSomeValue() {
'hello world'
}
}
尚不清楚您的应用程序可能出什么问题,但以上引述问题的答案为"is"。
关于grails - Grails Controller 名称中可以有数字吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36838338/