Why should the JSP page encoding directive be the first line in the JSP?

I mean the following directive

<%@ page contentType="text/html; charset=UTF-8" %> 

I have a lot of JSP. I wrote this line in a shared file that was already included in all JSPs. But this did not help, I could see a browser using a different encoding than what I indicated in the directive above.

I had to manually write this directive as the first line to solve the problem.

I ask this question in the context of the problem raised in this article.

+3
source share
2 answers

, , , , , - , String , , , - .

+3

Java, JSP , , , , ?

-1

Source: https://habr.com/ru/post/1794085/


All Articles