2

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 getting plain text output, this is all being wrapped in a span. How do i get rid of the span?

mkoryak
  • 57,086
  • 61
  • 201
  • 257

2 Answers2

5

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})
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
1

what about simply putting:

something("#{bean.val}");
Vladimir Ivanov
  • 42,730
  • 18
  • 77
  • 103