On 15/12/09 6:31 PM, Tim Nelson wrote:
> You need to remove the if guard on the first case match and change the
> second parameter you are passing to Req. The second param is for the
> context. Try this:
>
> LiftRules.determineContentType = {
>    case (Full(Req("location" :: "maps" :: "testmap" :: Nil, _,
> GetRequest)), Full(accept)) =>      "text/html; charset=utf-8"
>    case _ =>  "application/xhtml+xml; charset=utf-8"
> }

However, in this case LiftRules.determineContentType is ignored 
completely. You could consider adjusting it like so:

LiftRules.determineContentType = {
   case (Full(Req("location" :: "maps" :: "testmap" :: Nil, _, 
GetRequest)), _) =>
       "text/html; charset=utf-8"

   case (_, Full(accept))
     if LiftRules.useXhtmlMimeType && 
accept.toLowerCase.contains("application/xhtml+xml") =>
       "application/xhtml+xml; charset=utf-8"

   case _ => "text/html; charset=utf-8"
}

Cheers, Indrajit

>
> Tim
>
> On Tue, Dec 15, 2009 at 6:09 AM, Tweek<d.sztwio...@gmail.com>  wrote:
>> It still dosn't work :(
>>
>> this is path to my html file, which is using google maps api: ./
>> location/maps/testmap.html
>>
>> i put in my Boot.scala file this code:
>>
>>         LiftRules.determineContentType = {
>>             case (Full(Req("location" :: "maps" :: "testmap" :: Nil,
>> "html", GetRequest)), Full(accept))
>>                 if LiftRules.useXhtmlMimeType&&
>> accept.toLowerCase.contains("application/xhtml+xml") =>
>>                 "text/html; charset=utf-8"
>>             case _ =>  "application/xhtml+xml; charset=utf-8"
>>         }
>>
>> i can't disable XHTML in whole projcet becouse then i'm losing
>> functionality like jquery datepicker etc.
>>
>> Could You tell me what i did wrong?
>>
>> Thanks
>>
>> On 15 Gru, 10:38, Timothy Perrett<timo...@getintheloop.eu>  wrote:
>>> You need to put it in your Boot.scala file.
>>>
>>> determineContentType is of PartialFunction[(Box[Req], Box[String]), String] 
>>> type - this means that you can match on particular paths:
>>>
>>>      LiftRules.determineContentType = {
>>>        case (Full(Req("some" :: "path" :: Nil, "pdf", GetRequest)), 
>>> Full(accept))
>>>          if LiftRules.useXhtmlMimeType&&  
>>> accept.toLowerCase.contains("application/xhtml+xml") =>
>>>              "application/xhtml+xml; charset=utf-8"
>>>        case _ =>  "text/html; charset=utf-8"
>>>      }
>>>
>>> Cheers, Tim
>>>
>>> On 15 Dec 2009, at 07:58, Tweek wrote:
>>>
>>>> Thanks for answer Tim.
>>>
>>>> I know it will be a nooby question, but how i need to define this
>>>> site, where i don't want XHTML ?
>>>
>>>> On 14 Gru, 12:30, Tim Nelson<tnell...@gmail.com>  wrote:
>>>>> You can use LiftRules.determineContentType to do this. Here is a
>>>>> sample from my project:
>>>
>>>>> LiftRules.determineContentType = {
>>>>>    case (_, Full(accept)) if LiftRules.useXhtmlMimeType&&
>>>>> accept.toLowerCase.contains("application/xhtml+xml") =>
>>>>>          "application/xhtml+xml; charset=utf-8"
>>>>>    case _ =>  "text/html; charset=utf-8"
>>>
>>>>> }
>>>
>>>>> Tim
>>>
>>>>> On Mon, Dec 14, 2009 at 3:59 AM, Tweek<d.sztwio...@gmail.com>  wrote:
>>>>>> Hi Guys
>>>
>>>>>> Is it possible todisableXHTMLonly in one html file?
>>>
>>>>>> When i put
>>>>>> "LiftRules.useXhtmlMimeType = false"
>>>>>>   in Boot.scala then i'll swich this off in whole project.
>>>
>>>>>> Is any other place to put this line?
>>>
>>>>>> Thanks.
>>>
>>>>>> --
>>>
>>>>>> You received this message because you are subscribed to the Google 
>>>>>> Groups "Lift" group.
>>>>>> To post to this group, send email to lift...@googlegroups.com.
>>>>>> To unsubscribe from this group, send email to 
>>>>>> liftweb+unsubscr...@googlegroups.com.
>>>>>> For more options, visit this group 
>>>>>> athttp://groups.google.com/group/liftweb?hl=en.
>>>
>>>> --
>>>
>>>> You received this message because you are subscribed to the Google Groups 
>>>> "Lift" group.
>>>> To post to this group, send email to lift...@googlegroups.com.
>>>> To unsubscribe from this group, send email to 
>>>> liftweb+unsubscr...@googlegroups.com.
>>>> For more options, visit this group 
>>>> athttp://groups.google.com/group/liftweb?hl=en.
>>
>> --
>>
>> You received this message because you are subscribed to the Google Groups 
>> "Lift" group.
>> To post to this group, send email to lift...@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> liftweb+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/liftweb?hl=en.
>>
>>
>>
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/liftweb?hl=en.
>
>

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.


Reply via email to