grails - Grails Controller 名称中可以有数字吗

标签 grails grails-controller

我可以有一个名为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/

相关文章:

git - Grails警告:没有安装SCM提供程序Stash GIT存储库

Grails oauth 插件 : Unknown provider linkedin, 检查你的配置

grails - 由于缺少默认c'tor,bean的实例化失败

grails - Grails创建内部服务类的实例

grails - withCriteria获取关联对象的列表

grails - Cloudfoundry上具有多个实例的Grails Quartz2插件?

grails - Json调用Rest URL到Grails GSP页面

hibernate - 在字段 'objname'上对象:'fieldname'中引起的错误:拒绝的值[null];

grails - 如何在 Grails 中实例化惰性列表?

java - 将日期作为 UTC 保存到数据库