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

M.Takahashi [E-MAIL ADDRESS DELETED]
2008年 9月 7日 (日) 21:57:32 JST


お世話になっております。
高橋です。

> Struts2 の property タグはボディを処理するので、ボディに何かを記述すれば
> それは出力されてしまいます。
> struts の html:errors と同じですね。
> 
> つまり JSP でこう書いた場合と同じです。
> <s:property value="%{message}">あいうえお</s:property>

Struts2 の property タグはtldファイルが
<body-content>empty</body-content>
となっているので
JSPに<s:property value="%{message}">あいうえお</s:property>
と書くと実行時にエラーになりますが、逆にボディを評価しないので
<body-content>empty</body-content>のときは、
そのままボディが出力されるということでしょうか?

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

なるほど、このようなテクニック?で問題が回避できるわけですね。

よろしくお願いいたします。


> 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 mailing list
> [E-MAIL ADDRESS DELETED]
> https://ml.seasar.org/mailman/listinfo/mayaa-user



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