日期:2014-05-17 浏览次数:20797 次
static void check(String name,String key) throws EasyWebException
{
Element el = null;
try {
System.out.println("-------------start");
el = (Element)XPath.selectSingleNode(root, "client[@name='" + name + "']");
System.out.println("-------------ok");
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.println("==============="+e.getMessage());
//e.printStackTrace();
}
if(el == null){
throw new EasyWebException(100100,"Client:check 名称不存在");
}
else{
String md5 = el.getAttributeValue("key");
String t = Safety.encryptToMD5(key);
if(!md5.equals(t)){
throw new EasyWebException(100101,"Client:check 密码不正确");
}
}
}
el = (Element)XPath.selectSingleNode(root, "client[@name='" + name + "']");