請問在Eclipse下怎麼編譯JavaBean

js19830506發表於2006-11-13
在Eclipse我已經把需要匯入的兩個包配好了,程式碼沒有錯誤提示了,但是我這個程式碼沒有 main方法不能執行,請問哪位高手告訴我怎麼編譯啊?在下不勝感激!

package alan.struts.basic;

import org.apache.struts.action.*;
import alan.ums.entity.User;

public class UserForm extends ActionForm
{
    private String userName;
    private String password;
    
    public void setUserName(String userName)
    {
        this.userName = userName;
    }
    
    public String getUserName()
    {
        return userName;
    }
    
    public void setPassword(String password)
    {
        this.password = password;
    }
    
    public String getPassword()
    {
        return password;
    }
    
    public User getUser()
    {
    	User user = new User();
    	user.setUserName(userName);
    	user.setPassword(password);
    	
    	return user;
    }
}
<p class="indent">

相關文章