アクションクラスで検出されたエラーを表示したいので、次を使用します。
errors.add(ActionErrors.GLOBAL_MESSAGE,
new ActionMessage("some_string_in_properties_file"));`
そしてそれはうまくいきます。ただし、いくつかの一般的なエラーメッセージを書いており、それらを再利用したいので、これをやろうとしています:
errors.add(ActionErrors.GLOBAL_MESSAGE,
new ActionMessage("string1_in_properties_file", "string2_in_properties_file"));
ここで、string1 = <li>{0} is required.</li>
.
すると表示されstring2 is required
ます。string2 をその値に置き換えていません。
私も試してみました
errors.add(ActionErrors.GLOBAL_MESSAGE,
new ActionMessage("string1_in_properties_file",
new ActionMessage("string2_in_properties_file")));
それは表示されていstring2[] is required
ます。string2 を置き換えるものではありません。
値をハードコーディングすることでできることは知っていますが、他に方法はありますか?