paauthenticator.java

来自「精通Jboss——Ejb和Web Services开发精解的随书源代码」· Java 代码 · 共 36 行

JAVA
36
字号
/**
 * 
 * PAAuthenticator.java
 * 
 * Created on 2003-8-18 15:44:23
 * 
 */
package com.liuyang.jboss.sessionbean.notify.ejb;


import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;

/**
 * @author
 * <a href="mailto:jdcyang@yahoo.com.cn">刘洋</a>
 */
public class PAAuthenticator extends Authenticator {

	private String username;

	private String password;
	public PAAuthenticator(String user,String pass){
		username = user;
		password = pass; 
	}
	/* (non-Javadoc)
	 * @see java.net.Authenticator#getPasswordAuthentication()
	 */
	protected PasswordAuthentication getPasswordAuthentication() {
		PasswordAuthentication pa = new PasswordAuthentication(username,password);
		return pa;
	}

}

⌨️ 快捷键说明

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