public String changePassByUser()//用户修改自身的密码,需要输入旧密码
{
resultInfo = new OperResult();
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
String name = authentication.getName();
IChangePassword iChangePassword = (IChangePassword)StorageService.ctx.getBean("jdbcUserService");//只能强制转为此接口,不知为何
// CustomJdbcDaoImpl customJdbcDaoImpl = (CustomJdbcDaoImpl)StorageService.ctx.getBean("jdbcUserService");//cast exception??
if(iChangePassword!=null)
{
String oldPass = request.getParameter("oldPass");
String newPass = request.getParameter("newPass");
try{
iChangePassword.changePassword(name, oldPass, newPass);//pass能否为空?
resultInfo.setSucceed();
}
catch(BadCredentialsException e)
{
e.printStackTrace();