When I try to display German text e.g., Zurücksetzen on a JSP through request.setAttribute()
, it comes out as Zur�cksetzen
.
request.setAttribute("test", "Zurücksetzen");
My JSP page defines contentType as UTF-8:
<%@ page contentType="text/html;charset=UTF-8" %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
and I am displaying the attribute simply with ${test}
.
The text is displayed correctly if I forward the request to the JSP page instead of include the JSP
Forward (working):
request.getRequestDispatcher("/WEB-INF/views/index.jsp").forward(request, response);
Include (not working):
request.getRequestDispatcher("/WEB-INF/views/index.jsp").include(request, response);
My IDE is using UTF-8