0

I use a lot of jQuery plugins in my JSF 2.0 application and not all of them generate HTML which can successfully pass through the strict XHTML checks of webkit browsers. So the solution is to actually get into the plugin's code and correct it so that it generates a valid HTML, which is a very time consuming process in itself, or, wrap the contents of generated HTML in <f:view contentType="text/html">. The latter is quite straight forward and it works. Are there any cons of using <f:view> to override the content type in such a manner?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Niks
  • 4,802
  • 4
  • 36
  • 55

1 Answers1

0

JSF defaults to the closest media type in the Accept header as is been sent by the webbrowser. If the URL matches *.xhtml, then it will usually end up to be application/xhtml+xml in some browsers and text/html in other browsers. You can without any problems force it to be text/html, most browsers treat XHTML as HTML anyway. Forcing to application/xhtml+xml is however a different story: MSIE doesn't support it in any way.

See also:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555