⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 passwordhint.java

📁 this is for appfuse1.8 source using strut 1.x, spring and hibernate.
💻 JAVA
字号:
package org.appfuse.webapp.action;import org.appfuse.model.User;import org.appfuse.webapp.util.RequestUtil;/** * Managed Bean to send password hints to registered users. * * <p> * <a href="PasswordHint.java.html"><i>View Source</i></a> * </p> * * @author <a href="mailto:matt@raibledesigns.com">Matt Raible</a> */public class PasswordHint extends BasePage {    private String username;        public String getUsername() {        return username;    }        public void setUsername(String username) {        this.username = username;    }    public String execute() {                // ensure that the username has been sent        if (username == null || "".equals(username)) {            log.warn("Username not specified, notifying user that it's a required field.");            addError("errors.required", getText("user.username"));            return null;        }                if (log.isDebugEnabled()) {            log.debug("Processing Password Hint...");        }                // look up the user's information        try {            User user = userManager.getUser(username);            StringBuffer msg = new StringBuffer();            msg.append("Your password hint is: " + user.getPasswordHint());            msg.append("\n\nLogin at: " + RequestUtil.getAppURL(getRequest()));            message.setTo(user.getEmail());            String subject = getText("webapp.prefix") + getText("user.passwordHint");            message.setSubject(subject);            message.setText(msg.toString());            mailEngine.send(message);                        addMessage("login.passwordHint.sent",                        new Object[] { username, user.getEmail() });                    } catch (Exception e) {            e.printStackTrace();            // If exception is expected do not rethrow            addError("login.passwordHint.error", username);        }        return "success";    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -