Antranig - August 8, 2008

MathML Support and File Extensions on Templates

mjnsakai: quick question.
AntranigBasman: Afternoon (smile)
mjnsakai: Can I use .xhtml as a file extension on my RSF templates?
AntranigBasman: Yes, if you modify the ContentTypeInfo thingery
AntranigBasman: Although I rarely found this was very pleasant
AntranigBasman: I can't remember the reason now (tongue)
AntranigBasman: But I recall something bad happened in the OS when trying to edit these files (tongue)
mjnsakai: It turns out that FireFox behaves differently if the request is against an HTML vs XHTML document.
mjnsakai: Name spaced extensions are supported in the later, but not the former.
mjnsakai: These include MathML and SVG.
AntranigBasman: Yes
mjnsakai: Its possible that this info might be hidden in an HTML header somewhere, tho.
AntranigBasman: But I believe what it listens to more authoritatively is the HTTP request header?
mjnsakai: yeah, my thought as well.
AntranigBasman: I mean, the actual file extension is not in the final request anyway
mjnsakai: true
mjnsakai: I can add headers, right?
AntranigBasman: Since at the moment, RSF URLs are extensionless
AntranigBasman: Yes
AntranigBasman: Again, you can tinker with the core ContentTypeInfo record
mjnsakai: ok, that's worth exploring.
AntranigBasman: Or esle, just mess with the request directly, if you need some more funny headers
mjnsakai: can I override one that RSF generates?
AntranigBasman: Yes
mjnsakai: great.
AntranigBasman: Simply write a bean the prods ContentTypeInfoRegistry.addContentTypeInfo at startup
AntranigBasman:

public static final ContentTypeInfo HTML_CONTENTINFO = 
     new ContentTypeInfo(HTML, "html",  "<!DOCTYPE html      "
         + "PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\""
         + " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">",
         "text/html; charset=UTF-8",
         ContentTypeInfo.ID_FULL, false
         );