Announcement Announcement Module
Collapse
No announcement yet.
Missing tag <g:inject> after grails upgrade 2.1.1 to 2.2.1 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Missing tag <g:inject> after grails upgrade 2.1.1 to 2.2.1

    Hello,

    Use of <g:inject> in a gsp causes the following exception (in both a new and the existing upgraded project).

    "Tag [inject] does not exist. No tag library found for namespace: g. Stacktrace follows:
    Message: Error processing GroovyPageView: Tag [inject] does not exist. No tag library found for namespace: g
    ...
    Caused by GrailsTagException: Tag [inject] does not exist. No tag library found for namespace: g
    I noticed that the ApplicationTagLib API docs for 2.1.1 include "inject" while those for 2.2.1 do not:
    http://grails.org/doc/2.1.1/api/org/...ionTagLib.html
    http://grails.org/doc/2.2.1/api/org/...ionTagLib.html

    Has this handy tag been "deprecated?"

    Thank you,

  • #2
    Looks like it was merged into the "set" tag in this commit: https://github.com/grails/grails-cor...0d8245504bfeed

    The "beanName" attribute would now be just "bean".

    What are you using this for? In general it's a bad idea to do logic in a GSP, but instead do the work in the controller or a service and pass the data to be rendered to the view.

    Comment


    • #3
      Thanks Burt, for the quick reply and recommendations.

      I used the tag as a convenient data provider for some cached reference data by calling a service method. I had already written the controller prior to finding and using the tag. However, there should be no reason why I can't provide the data by way of the controller (other than continue to be lazy

      Comment

      Working...
      X