For example, in view. jsp, you must pass the parameter value to list. jsp bloodname.
<Portlet: Param name = "bloodname" value = "<% = B. getbloodname () %>"/>
However, in list. jsp, use string bloodname = request. getparameter ("bloodname ");
The obtained value is garbled. Try to set the passed parameter value for encoding conversion.
<%
// Request. setcharacterencoding ("gb2312 ");
%>
It is not easy to use. Later, I tried this method in the previous post, and it is not easy to use.
The default request of SP is iso8859_1, so when processing Chinese,
To display Chinese characters, it must be converted to GBK, as shown below:
String STR = new string (request. getparameter ("name"). getbytes ("ISO8859-1"), "GBK ");
Out. println (STR );
This will display Chinese characters.
To put string STR = new string (request. getparameter ("name"). getbytes ("ISO8859-1"), "GBK"); In
Change GBK to utf_8 for ease of use
Therefore, in list. jsp, you need to write the value
String bloodname = new string (request. getparameter ("bloodname"). getbytes ("ISO8859-1"), "utf_8 ");