读书人

JSF框架简介与范例

发布时间: 2012-11-22 00:16:41 作者: rapoo

JSF框架简介与实例

?后台代码

/JSFLoginDemo/src/com/qdu/sun/jsf/LoginBean.java

?

代码/** *  */package com.qdu.sun.jsf;/** * @author sun1 * */public final class LoginBean extends Object {    /**     *      */    private String password;    /**     *      */    private String username;    /**     * @return the password     */    public String getPassword() {        return password;    }    /**     * @param password the password to set     */    public void setPassword(String password) {        this.password = password;    }    /**     * @return the username     */    public String getUsername() {        return username;    }    /**     * @param username the username to set     */    public void setUsername(String username) {        this.username = username;    }    public String login() {         if ((username == null) || (username.length() < 1))         return "fail";         if ((password == null) || (password.length() < 1))         return "fail";         if ((username.equals("孙更新")) && (password.equals("123")))         return "success";         else         return "fail";         } }

读书人网 >JavaScript

热点推荐