开发者

JSF 1.2 outputText tag generates a span

开发者 https://www.devze.com 2023-01-27 17:31 出处:网络
I am new to JSF 1.2, I am trying to output some text into my javascript call like so something(<t:outputText value=\"#{bean.val}\"/>)

I am new to JSF 1.2, I am trying to output some text into my javascript call like so

something(<t:outputText value="#{bean.val}"/>)

but instead of g开发者_开发技巧etting plain text output, this is all being wrapped in a span. How do i get rid of the span?


I am not sure about t:outputText, but an h:outputText without any other attribute than value should not render any HTML element.

something(<h:outputText value="#{bean.val}"/>);

If you're using id, styleClass or something like that, then it will indeed render a <span> since those attributes has to get somewhere anyway.

If you're using Facelets as view technology instead of legacy JSP, then you could also just use EL in template text like follows:

something(#{bean.val})


what about simply putting:

something("#{bean.val}");
0

精彩评论

暂无评论...
验证码 换一张
取 消