Reputation: 2492
How to display right content on jsp page or any configuration need to done in tomcat server...?
display at jsp : Hello G�nter
original content : Hello Günter
We do the following but its not working.
<%@ page language="java" contentType="text/html; charset=ISO-8859-15"
pageEncoding="UTF-8"%>
Upvotes: 4
Views: 9211
Reputation: 11508
As most other people have said, you should probably check the encoding of the actual file on the file system. Even if the server is instructed to serve out UTF-8, if the file is mangled, you'll get the wrong output.
Among the most common tools, you can use Notepad++ or Eclipse to check the encoding of the file. In Notepad++, open the file and click the Encoding tab. Make sure that "Encode as UTF-8" is selected.
In eclipse, you need to right-click the file in the project explorer. In the Resource tab, the bottom property is "Text file encoding". Make sure that UTF-8 is selected there.
FYI, I had a similar encoding issue a while ago, on Weblogic. The order of the parameters in the attributes affected the way the page behaved. You can find more info here, although I don't think it applies to your problem.
Upvotes: 2
Reputation: 6738
Your jsp page is OK. So make sure your browser's character encoding is UTF-8.
Upvotes: 0
Reputation: 27614
Eclipse defaults to your platform encoding when saving files. If you are on windows, this will most likely not be UTF-8. To change this, either right-click the file (jsp) in eclipse, click properties and at the bottom you can set the encoding it saves the file in.
To change the default content type in Eclipse, you can go to Windows->Preferences and under General / Content Types you can set default encoding to save as for different file types.
Upvotes: 0
Reputation: 5654
Upvotes: 0
Reputation: 3640
Upvotes: 0