如何嵌套插件网址? [英] How to nest plugin URLs?

查看:109
本文介绍了如何嵌套插件网址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个Grails项目的Shell,该项目在插件中托管功能,URL由插件名称分隔。


$ b 因此,在shell项目中使用的博客插件可能如下所示: / shell / blog / viewBlogPost



<但是我实际上看到的是所有插件的控制器都表现得好像它们是shell项目本身的一部分一样: /shell/viewBlogPost



有没有什么方法可以声明Blog插件的控制器只能在URL中的 / blog 路径下访问?

解决方案

似乎Grails插件无法做到这一点。问题是,它们缺少封装和可组合性,导致工件冲突:


  • 来自插件的URL路由简单地合并在一起,不能嵌套

  • 控制器不是名称空间

  • 服务不是名称空间



我提出了一个问题: GRAILS-9300



Grails团队有暂定计划来解决此问题在2.2中,通过使用插件名称作为工件名称空间。


I would like to create a "Shell" of a Grails project that hosts functionality in plugins, with the URLs segregated by plugin name.

So the URLs for a Blog plugin used in the Shell project might look like: /shell/blog/viewBlogPost

But what I'm actually seeing is all of the plugins' controllers behave as if they are part of the shell project itself: /shell/viewBlogPost

Is there any way to declare that the Blog plugin's controllers be accessible only under a /blog path in the URL?

解决方案

It seems like Grails plugins are not able to do this. The problem is that they lack encapsulation and composability, leading to artifact conflicts:

  • URL routing from plugins is simply merged together and cannot be nested
  • Controllers are not namespaced
  • Services are not namespaced

I opened an issue: GRAILS-9300

The Grails team has tentative plans to address this in 2.2, by using the plugin name as a namespace for artifacts.

这篇关于如何嵌套插件网址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆