Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 441 Bytes

tomcat7-jsp-charset-utf8.md

File metadata and controls

15 lines (11 loc) · 441 Bytes

Title: JSP: Changing the page encoding to UTF-8 Tags: jsp,jsp-charset

Put this in your web.xml to change the page encoding:

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

Now any jsp file you render, from a servlet or wherever, will have the UTF-8 charset in its response headers, i.e:

	Content-Type:text/html;charset=UTF-8