scala - Incorrect MIME type for GET requests -
i've been using lift web framework rest service quite while, need use stand alone tool now.
<lift:surround with="default" at="content"> <head> <script data-lift="with-resource-id" src="/test.js" type="text/javascript"></script> </head> <h2>welcome project!</h2> <p><lift:helloworld.howdy /></p> </lift:surround>
i have above basic lift template. problem when view in browser adding <?xml>
doctype , browser defaults interpreting resource xml instead of plain html.
how tell jetty/lift static file html?
sounds may using xhtml doctype. in boot.scala
file, may want try adding:
liftrules.htmlproperties.default.set((r: req) => new html5properties(r.useragent))
that should set application use html5, , should turn off adding <?xml...
encoding header.
also, @vasyanovikov mentioned, lift:
prefixed tags older construct (even though lot of documentation still mentions them). still work have issues html5. recommended use either of equivalent forms:
original:
<lift:surround with="default" at="content">...</lift:surround>
html5:
<span data-lift="surround?with=default;at=content"></span> <span class="lift:surround?with=default;at=content"></span>
if want use lift:
variety, biggest issue you'll find in html5 tags , attributes converted lowercase, <lift:helloworld.howdy />
interpreted <lift:helloworld.howdy />
, , lift not find snippet. using <span data-lift="helloworld.howdy"></span>
should allow work around that.
Comments
Post a Comment