[mayaa-user:687] Re: struts2のカスタムタグについて

suga [E-MAIL ADDRESS DELETED]
2008年 9月 7日 (日) 11:52:30 JST


suga です。

Struts2 の property タグはボディを処理するので、ボディに何かを記述すれば
それは出力されてしまいます。
struts の html:errors と同じですね。

つまり JSP でこう書いた場合と同じです。
<s:property value="%{message}">あいうえお</s:property>


Mayaa の記述でこの問題を避けるなら、一番楽なのは下の書き方だと思います。
<m:with m:id="message2"><s:property value="%{message}" /></m:with>

-- 
suga ( [E-MAIL ADDRESS DELETED] )



2008/9/7 M.Takahashi <[E-MAIL ADDRESS DELETED]>:
>
> 高橋と申します。
>
> Doltengからstruts2+mayaaの構成でプロジェクトを作成しているのですが、
> 下記のように記述したときに出力が
> Seasar2
> ではなく
> Seasar2あいうえお
> のようになってしまいます。
>
> m:writeタグやc:outタグではSeasar2と出力されます。
> struts2のカスタムタグも同様な結果にできないでしょうか?
>
> - mayaa-1.1.8
> - struts2-2.0.11.2
>
>
> よろしくお願いいたします。
>
>
>
> IndexAction.java
> ----------------------------
> @Result(type = MayaaResult.class, value = "index.html")
> public class IndexAction extends ActionSupport {
>        public String getMessage(){
>                return "Seasar2";
>        }
> }
>
> index.html
> --------------------------
> <span id="message2">あいうえお</span>
>
> index.mayaa
> --------------------------
> <s:property m:id="message2" value="%{message}" />
>
> _______________________________________________
> mayaa-user mailing list
> [E-MAIL ADDRESS DELETED]
> https://ml.seasar.org/mailman/listinfo/mayaa-user
>


mayaa-user メーリングリストの案内