Encode in JSP before Decoding in action
Encodeuri ("Chinese") Encoding
Urldecoder. Decode (request. getparameter ("parameter name"), "UTF-8"); complete decoding.
Example: URL: "qtypenums. Action? Typeid = <s: property value = 'typeid' escape = 'false'/> & qmobile = <s: property value = 'qmobile' escape = 'false'/> & QNAME = "+ encodeuri ('<s: property value = 'qname' escape = 'false'/> ') + "& qattr1 =" + encodeuri (' <s: property value = 'qattr1' escape = 'false'/> ') + "& qattr2 =" + encodeuri (' <s: property value = 'qattr2' escape = 'false'/> ') + "& qattr3 =" + encodeuri (' <s: property value = 'qattr3' escape = 'false'/> ')),
Decoding in action
String QNAME = This. getqname ();
String qattr1 = This. getqattr1 () = NULL? "": This. getqattr1 ();
String qattr2 = This. getqattr2 () = NULL? "": This. getqattr2 ();
String qattr3 = This. getqattr3 () = NULL? "": This. getqattr3 ();
String qname1 = "";
String qattr11 = "";
String qattr21 = "";
String qattr31 = "";
Try {
Qname1 = urldecoder. Decode (QNAME, "UTF-8 ");
Qattr11 = urldecoder. Decode (qattr1, "UTF-8 ");
Qattr21 = urldecoder. Decode (qattr2, "UTF-8 ");
Qattr31 = urldecoder. Decode (qattr3, "UTF-8 ");
} Catch (exception W ){}