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

📄 infobean.java

📁 《精通Spring》源代码
💻 JAVA
字号:
/* * Created on 2004-11-21 * * http://www.open-v.com 提供代码的维护工作 */package com.openv.spring.jsf;import javax.faces.context.FacesContext;import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;import org.springframework.context.ApplicationContext;import org.springframework.web.jsf.FacesContextUtils;import com.openv.spring.domainmodel.UserInfoVO;import com.openv.spring.service.IExample29Manager;/** * InfoBean,供处理home.jsp事件使用。 *  * @author luoshifei */public class InfoBean {    private static final Log log = LogFactory.getLog(InfoBean.class);    private String username = null;    private String email = null;    private String response = null;    private long maximum = 0;    private boolean maximumSet = false;    private long minimum = 0;    private boolean minimumSet = false;    //    private IExample29Manager example29Manager;            public InfoBean() {    }    /**     * @return Returns the email.     */    public String getEmail() {        return email;    }    /**     * @param email     *            The email to set.     */    public void setEmail(String email) {        this.email = email;    }    /**     * @return Returns the username.     */    public String getUsername() {        return username;    }    /**     * @param username     *            The username to set.     */    public void setUsername(String username) {        this.username = username;    }    /**     * 用于处理用户触发的事件     *      * @return <from-outcome>逻辑名     */    public String submitPersonInfo() {        log.info(username);        log.info(email);        ApplicationContext ac = FacesContextUtils                .getWebApplicationContext(FacesContext.getCurrentInstance());        IExample29Manager em = (IExample29Manager) ac                .getBean("example29Service");        UserInfoVO uiVO = new UserInfoVO();        uiVO.setUsername(username);        uiVO.setEmail(email);        boolean flag = em.setUserInfo(uiVO);//        boolean flag = example29Manager.setUserInfo(uiVO);        if (flag) {            setResponse("注册成功");            return "success";        } else {            setResponse("注册失败");            return "failure";        }    }    /**     * @param response     *            The response to set.     */    public void setResponse(String response) {        this.response = response;    }    public String getResponse() {        return null;    }    public long getMaximum() {        return (this.maximum);    }    public void setMaximum(long maximum) {        this.maximum = maximum;        this.maximumSet = true;    }    public long getMinimum() {        return (this.minimum);    }    public void setMinimum(long minimum) {        this.minimum = minimum;        this.minimumSet = true;    }//    /**//     * @return Returns the example29Manager.//     *///    public IExample29Manager getExample29Manager() {//        return example29Manager;//    }//    /**//     * @param example29Manager The example29Manager to set.//     *///    public void setExample29Manager(IExample29Manager example29Manager) {//        this.example29Manager = example29Manager;//    }    }

⌨️ 快捷键说明

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