**
**
** function stringToHex(str){ var bytesT = []; for(var i = 0; i < str.length; i++){ bytesT.push(str.charCodeAt(i).toString(16)); } return bytesT; } **
** 提交的时候,把密码加密重新赋值给 密码框。 ("#password").setValue(stringToHex($("#password").getValue())); document.loginForm.submit();
**
**
public String passwordArrDecode(String[] conferTypeCode){ String pwd = "" ; String pwdString = conferTypeCode[0]; String[] pwdArr = pwdString.split(","); byte [] bytes = new byte [pwdArr.length] ; for(int i=0 ;i<pwdArr.length ;i++){ bytes[i] = (byte) Integer.parseInt(pwdArr[i], 16); } try{ pwd = new String(bytes, "utf-8") ; System.out.println(new String(bytes, "utf-8")); }catch(Exception e){ } return pwd ; }