Encoding 从JSP到PortletRequest的UTF-8编码

Encoding 从JSP到PortletRequest的UTF-8编码,encoding,utf-8,Encoding,Utf 8,服务器端代码: In the input field of the jsp page we are giving some value with special characters Arągł but those are not coming as given in the form. The value of the String query should be same as given but it's some thing like ArÄgÅ public void sendFo

服务器端代码:

 In the input field of the jsp page we are giving some value with special characters Arągł but those are not coming as given in the form. The value of the String query should be same as given but it's some thing like ArÄgÅ
public void sendForm(PortletRequest请求,模型模型)引发不支持的DencodingException{
Map renderParams=request.getParameterMap();
for(条目:renderParams.entrySet()){
最后一个字符串key=entry.getKey();
最后一个字符串[]c=entry.getValue();
如果(c!=null&&c.length>0){
if(key.contains(“查询”)){
字符串查询=c[0];
}
}
}
}
JSP代码:

     public void sendForm(PortletRequest request, Model model) throws UnsupportedEncodingException {   
             Map<String, String[]> renderParams = request.getParameterMap();
             for (Entry<String, String[]> entry : renderParams.entrySet()) {
                final String key = entry.getKey();
              final String[] c = entry.getValue();
                if (c != null && c.length > 0) {
                   if(key.contains("query")) {
                        String query = c[0];
                   }
                }
           }
        }

在jsp页面的输入字段中,我们用特殊字符Arągł给出了一些值,但这些值与表单中给出的值不同。字符串查询的值应该与给定的值相同,但类似于ArÄgÅ

<%@ taglib prefix="portlet" uri="http://java.sun.com/portlet_2_0" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <portlet:defineObjects />

    <portlet:actionURL var="formUrl" name="sendForm"/>

    <form name="editForm" 
          method="POST"
          action="${formUrl}"
          >
    <input type="text" name="query" id="query"/> 
        <input value="Submit" type="submit" />
    </form>