I need to encode all of my JSPs as UTF-8.
I've looked around and found that I can use the following page directive to accomplish this:
<%@page pageEncoding="UTF-8"%>
This works perfectly, but I need a way to include that directive to all of my JSPs. I don't want to paste it at the top of each JSP file in my project.
I have a header file that all my JSPs use to display the page header. I'd like to be able to set the page encoding in the included header file, and have it apply to the page that's including it. Unfortunately, from reading this, it looks like the <%@ page %>
directive only carries on to the children includes, so I can't just set the encoding in the header because the encoding won't be inherited by the actual page.
Can anyone give me a clean way to set the character encoding on all of my JSPs?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…