Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Setting text/javascript encoding to utf8 with Jetty 10.0.16

Thank you, Joakim - your second suggestion has worked well for me:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN"
<Configure class="org.eclipse.jetty.server.handler.ContextHandler">
    <Set name="contextPath">/</Set>
    <Set name="welcomeFiles">
        <Array type="string">
    <Set name="handler">
        <New class="org.eclipse.jetty.server.handler.ResourceHandler">
            <Set name="resourceBase">/var/www/html/</Set>
            <Set name="directoriesListed">true</Set>
    <Get name="mimeTypes">
        <Call name="addMimeMapping">

Now I get the following response headers and the file is displayed with correct international characters in the Microsoft Edge browser:

HTTP/1.1 200 OK
last-modified: Tue, 03 Oct 2023 09:52:40 GMT
content-type: text/_javascript_;charset=utf-8
accept-ranges: bytes
vary: Accept-Encoding
content-encoding: gzip
server: Jetty(10.0.16)
connection: close

Best regards

Back to the top