qq_28367089 2015-05-21 02:11 采纳率: 0%
浏览 1783

Action中调用另一个类中的方法时没有跳转,但是新建的其他测试类就可以跳转,WHY?

action中调用EmailUtil中的sendHtmlMail方法:
public void forgetPassword() throws Exception {
String email = request.getParameter("email");
User u=userService.getByEmail(email);

Json json=new Json();
if (StrUtils.isNotBlank(email) && u!=null ) {
String key=ConfigUtil.get("key");
String data = u.getId()+","+new Date().getTime();
String secret = URLEncoder.encode(Secret.encrypt(data, Secret.md5(key.getBytes())), "utf-8");
log.debug("加密后:"+secret);
StringBuffer content=new StringBuffer();
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
content.append("重设密码:");
content.append(secret);
content.append("

"+DateFactory.getDateTime()+"

");
String conMsg=content.toString();
try{
log.debug("+++++++++"+conMsg);
EmailUtil.sendHtmlMail("忘记密码,将密码设为默认密码!", content.toString(), null, email);

}catch(Exception e){
json.setSuccess(false);
json.setMsg("发送失败!");

}
json.setSuccess(true);
json.setMsg("发送成功!");
}else{

json.setMsg("该邮箱还没有注册,请检查输入!");

json.setSuccess(false);

}
writeJson(json);
}
这是一个实现往邮箱发邮件的功能,要调用的功能没有错,测试类中调用可以实现发邮件,但是在action中写的方法就是不能调用到该方法,没有执行
  • 写回答

1条回答

  • DreamTHT 2015-05-21 06:46
    关注

    打断点是怎么走的??到调用另一个类中的方法时是怎样的?直接过?报错?没进去?

    评论

报告相同问题?

悬赏问题

  • ¥15 vue3页面el-table页面数据过多
  • ¥100 vue3中融入gRPC-web
  • ¥15 kali环境运行volatility分析android内存文件,缺profile
  • ¥15 写uniapp时遇到的问题
  • ¥15 vs 2008 安装遇到问题
  • ¥15 matlab有限元法求解梁带有若干弹簧质量系统的固有频率
  • ¥15 找一个网络防御专家,外包的
  • ¥100 能不能让两张不同的图片md5值一样,(有尝)
  • ¥15 informer代码训练自己的数据集,改参数怎么改
  • ¥15 请看一下,学校实验要求,我需要具体代码