The DefaultServlet that jetty provides handles the transfer of common
static files.
It has been well tested for mime types.

However, it is very common for 3rd party libraries to override this
behavior<http://stackoverflow.com/questions/15852443/why-is-jetty-serving-css-with-text-html-content-type/15852710#15852710>
.
Since you didn't say if this was standalone or embedded, i'll just assume
standalone.
What to check:

   1. Make sure you have a web.xml (required for your version of the
   servlet spec)
   2. Make sure you are doing standard deployments (otherwise you are not
   wired up for standard servlet behavior)
   3. Make sure your distribution has a etc/webdefault.xml (otherwise you
   have nothing defining a default servlet)
   4. Make sure that the servlet named 'default' points to the jetty
   default servlet (otherwise you don't have a default servlet)
   5. Make sure that you don't override the default "/" mapping with your
   own servlet (otherwise you are not using jetty to serve that css file)
   6. Make sure you don't map to "/*" with your own servlet (otherwise you
   are not using jetty to serve that css file)

Btw, There have been over 100 releases of Jetty since version
6.1.24<https://gist.github.com/joakime/642ba1dbe2563fabfcd8#file-jetty-versions-txt-L1-L106>,
you should upgrade.


--
Joakim Erdfelt <[email protected]>
webtide.com <http://www.webtide.com/> - intalio.com/jetty
Expert advice, services and support from from the Jetty & CometD experts
eclipse.org/jetty - cometd.org


On Wed, Nov 6, 2013 at 1:14 PM, Christopher Melen <
[email protected]> wrote:

> Hi,
>
>
> I am serving Swagger UI <https://github.com/wordnik/swagger-ui> from the
> static content directory of my mock REST API in 
> SoapUI<http://www.soapui.org//>.
> SoapUI uses jetty-6.1.26.jar and jetty-util-6.1.26.jar. Unfortunately the
> Swagger css files are being served as application/x-pointplus, which both
> Opera and Firefox refuse to handle (haven't tried any other browsers).
>
>
> The html file referencing the css has the type correctly set to "text/css".
>
>
> I initially posted about this on the SoapUI forum, but was directed here
> instead. Is this really a Jetty problem, and if so what might be the
> solution be?
>
>
> Thanks for any help,
> Christopher
>
> _______________________________________________
> jetty-users mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>
>
_______________________________________________
jetty-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to