Hi Achim,

No sweat - I understand that you're a busy man. Also, this is not critical
for me after I resolved my real problem with the template.

The only way I've tested is to have my Pax-Web serve static files contained
in my bundle. I noticed that for my template files (with extension .ejs), I
don't get a Content-Type at all in the response. This is easy to see in
both Chrome and Firefox. Also, in Firefox console I get errors about
invalid XML. Seems like the default handling on the browser side is to
treat the files as XML if no Content-Type is specified (just my guess).

Now that I think of it, I use the "steal" functionality provided by
Javascript MVC. I think that "steal" uses AJAX request to load the
templates. That could be the reason why XML seems to be assumed.

Nonetheless, I think documenting how to map file extensions to Content-Type
using Pax-Web would be a good thing (I'm hoping it is supported).

/Bengt

2012/9/11 Achim Nierbeck <bcanh...@googlemail.com>

> Hi Bengt,
>
> sorry I'm quite busy right now.
> Do you have a simple test for me to reproduce, wich I can use for the
> itests?
> To my understanding it should work right away so it might possibly be a
> bug.
>
> regards, Achim
>
>
> 2012/9/10 Bengt Rodehav <be...@rodehav.com>:
> > As it turns out, the Content-Type wasn't the root of my problems. I had a
> > syntax error in my template (.ejs file) which caused a lot of problems
> that
> > were hard to detect.
> >
> > Nevertheless, I would like to specify that ".ejs" files should have the
> MIME
> > type "text/plain" since it is not given any Content-Type at all
> presently.
> > Judging from the error messages in Firebug it does seem like the browser
> (at
> > least Firefox) then tries to interpret it as XML.
> >
> > Does anyone know how to do this with Pax-Web?
> >
> > /Bengt
> >
> >
> > 2012/9/6 Bengt Rodehav <be...@rodehav.com>
> >>
> >> I'm using Karar 2.2.8 which includes Pax-Web 1.0.11. I'm using
> >> JavascriptMVC and its templating engine. The templates have the
> extension
> >> ".ejs".
> >>
> >> Until recently this worked fine but I now have lots of problems with
> this
> >> - probably due to "background updates" of my webb browsers. It seems
> like
> >> the web browser tries to interpret the .ejs files as xml and complains
> that
> >> it is not well-formed. The .ejs files do not have a Content-Type header
> in
> >> the response which probably leads the browser to do its "best guess".
> >>
> >> How can I tell Pax-Web that files with the extension ".ejs" shall have
> the
> >> Content-Type "text/plan"?
> >>
> >> /Bengt
> >
> >
> >
> > _______________________________________________
> > general mailing list
> > general@lists.ops4j.org
> > http://lists.ops4j.org/mailman/listinfo/general
> >
>
>
>
> --
>
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
> Committer & Project Lead
> OPS4J Pax for Vaadin
> <http://team.ops4j.org/wiki/display/PAXVAADIN/Home> Commiter & Project
> Lead
> blog <http://notizblog.nierbeck.de/>
>
> _______________________________________________
> general mailing list
> general@lists.ops4j.org
> http://lists.ops4j.org/mailman/listinfo/general
>
_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to