处理方式是在Action中加上1个组员自变量,储存编号后的汉语主要参数。在vm网页页面3D渲染时取下这个自变量值,再拼接超连接。
在这里碰到的难题是:启用java.net.URLEncoder的encode()方式时,假如沒有显示信息特定标识符集主要参数,那末URLEncoder会应用默认设置标识符集。这个默认设置标识符集在Eclipse里跑main()方式和在Tomcat里跑Web运用,获得的結果不1样,因此危害了编号的結果。
拷贝编码
编码以下:/**
* Translates a string into <code>x-www-form-urlencoded</code>
* format. This method uses the platform'sdefault encoding
* as the encoding scheme to obtain thebytes for unsafe characters.
*
* @param s <code>String</code> to betranslated.
* @deprecated The resulting string mayvary depending on the platform's
* default encoding. Instead, use theencode(String,String)
* method to specify the encoding.
* @return the translated <code>String</code>.
*/
@Deprecated
public static String encode(String s) {
String str = null;
try {
str = encode(s, dfltEncName);
} catch(UnsupportedEncodingException e) {
// The system should always have theplatform default
}
return str;
}
方式的注解中也表明了不提议应用的缘故是,这个encode(String)方式依靠于服务平台标识符集。