private String transStr(String s) {
String ss = null;
try {
ss = new String(s.getBytes("ISO8859-1"), StandardCharsets.UTF_8);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return ss;
}
<jsp:setProperty name="test" property="key" value='<%= transStr(request.getParameter("key"))%>'/>