Reputation: 4615
Is there a way to set default encoding type without the need to explicitly invoke
response.setCharacterEncoding("UTF-8");
request.setCharacterEncoding("UTF-8");
for each request/response?
Upvotes: 0
Views: 982
Reputation: 108899
The content type can be set in the JSP:
<%@page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
It isn't usual to set the encoding on the request. It suggests a defect somewhere else in the application. But if you want to set these things explicitly and globally, use a Filter.
Upvotes: 1