This is my Blog.

It's full of opinions on a wide range of stuff.

Explictially Setting Application DocType with Lift

As you might know, I use the lift framework a lot - I recently came across a strange issue where I couldnt set my own doctype in the layout template. Maybe this nugget of information will be usefull for someone:

ResponseInfo.docType = { 
  case _ if S.getDocType._1 => S.getDocType._2 
  case _ => Full(DocType.xhtmlStrict) 

Avalible options are:



UPDATE (Lift 2.1)

Be sure to use the following as ResponseInfo is deprecated.

LiftRules.docType.default.set(r => Full(DocType.xhtmlStrict))

Doing so will ensure you don't get any warnings etc during compile time.

blog comments powered by Disqus