I used servlet for create login session. When i enter username and password servlet call home.jsp page. Then all other jsp pages have same problem.i add code for all of them. But it doesnt solve problem. Please help me
The problem with character encoding problems is that the cause of it can be in many different places. You have to be careful and check everything:
- What character encoding are your source JSP files saved in by your IDE? Is it UTF-8 or some other encoding (maybe the default encoding of your OS which might be different than UTF-8)?
- Where does the text come from? Is it static text that's directly in the JSP file or does it come from a database or some other source?
- If it's from a database, then what character encoding does the database use? And how are you getting it from the DB? Is the character encoding handled correctly in every step?
- If it's from a Java *.properties file, you have to be aware that class java.util.Properties treats *.properties files as if they are always encoded in ISO-8859-1. If you've saved the *.properties file using any other encoding, you'll get mangled text.
In my experience, many software developers don't understand character encodings and they often end up trying to solve a character encoding problem by adding "magic lines" to their code (lines of code which they don't understand, but just hope that they solve the problem). Don't do that - it's better to learn once and for all how character encodings work, and then you don't have to rely on magic lines which you don't understand.