Map を Grails コントローラーに挿入しようとしています。多くのコントローラに同じマップを注入したいので、resources.groovy で定義したいと思います。
Web を調べましたが、単純なマップを作成する例が見つかりません。
Spring MVC では、次のようなものを使用しました。
<util:map id="diplomaPermissions">
<entry>
<key>1</key>
<value>Diploma_AQA_Building_And_Construction</value>
</entry>
<entry>
<key>1</key>
<value>Diploma_Edexcel_Building_And_Construction</value>
</entry>
</util:map>
これを私のxmlヘッダーに入れます:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd">
しかし、Spring xml ファイルを使用すると、これは grails では機能しないようです。
ヒントをいただければ幸いです。