FileDocCategorySizeDatePackage
MessageTag.javaAPI DocGlassfish v2 API3508Mon Oct 17 14:54:30 BST 2005demo

MessageTag

public class MessageTag extends TagSupport
Custom tag for retrieving a message.

Fields Summary
private String
folder
private String
session
private int
num
Constructors Summary
Methods Summary
public intdoStartTag()
Method for processing the start of the tag.

        MessageInfo messageinfo = new MessageInfo();
        try {
	    Folder f = (Folder)pageContext.getAttribute(
		getFolder(), PageContext.SESSION_SCOPE);
            Message message = f.getMessage(num);
            messageinfo.setMessage(message);
            pageContext.setAttribute(getId(), messageinfo);
        } catch (Exception ex) {
            throw new JspException(ex.getMessage());
        }
 
        return SKIP_BODY;
   
public java.lang.StringgetFolder()
folder attribute setter method.


             
       
        return folder;
    
public java.lang.StringgetNum()
num attribute getter method.

        return Integer.toString(num);
    
public java.lang.StringgetSession()
session attribute getter method.

        return session;
    
public voidsetFolder(java.lang.String folder)
folder setter method.

        this.folder = folder;
    
public voidsetNum(java.lang.String num)
num attribute setter method.

        this.num = Integer.parseInt(num);
    
public voidsetSession(java.lang.String session)
session attribute setter method.

        this.session = session;