次のようなコレクションの ID でパラメーター化された非常に単純なタグを作成したいと思います。
<s:url action="theaction" namespace="/" includeParams="all" id="histURL">
<s:param name="sources" value="sources.{id}"></s:param>
</s:url>
${histURL}
Action クラスに 3 つの Source オブジェクトが定義されていて、ID が 1、2、3 の場合、histURL の出力は次のようになります。
http://localhost:8080/myproject/theaction&sources=1&sources=2&sources=3
しかし、それは機能しません。次のように表示されます。
http://localhost:8080/myproject/theaction
別のヒント:
<s:url action="theaction" namespace="/" includeParams="all" id="histURL">
<s:param name="sources" value="sources"></s:param>
</s:url>
${histURL}
結果は
http://localhost:8080/myproject/theaction&sources=com.mycompany.Source@32324&sources= ...
したがって、パラメーターとしてのコレクションは機能します。OGNL プロジェクションはうまく機能すると思いますが、バグがあるようです。または、何か不足していますか?これはOGNLですか?:)
返信ありがとうございます。