在eclipse中新创建的jsp文件开头一般都有这两行代码。
问题来了,page编译指令中有charset设置,而meta标签中也有charset设置,最终究竟谁的起作用?
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorpage="" %> <meta http-equiv="content-type" content="text/html; charset=utf-8" />
经测试;
jsp的编译指令contentType设置会覆盖meta的设置
所以,最终,page中的设置起作用。