Jonathan Laliberte
Jonathan Laliberte

Reputation: 179

Special characters from xml files are showing question marks on JSP? java web

Have a simple java web application that uses a dictionary api to fetch data and shows it on a JSP.

But this character from the XML file is showing a question mark when processed? xml file, notice the underlined character

Here you can see the character showing a ? instead of the original.

output on a website from reading the xml

How can this be solved? Thanks for your time.

Upvotes: 1

Views: 1341

Answers (1)

Aditya Garimella
Aditya Garimella

Reputation: 933

Try adding this in your web.xml

<jsp-config>
    <jsp-property-group>
        <url-pattern>*.jsp</url-pattern>
        <page-encoding>UTF-8</page-encoding>
    </jsp-property-group>
</jsp-config>

If you have only one such jsp you can try adding the following page directive in the jsp

<%@page pageEncoding="UTF-8" %>

Upvotes: 1

Related Questions