POP taglib ver. 1.4

    Custom JSP tags library. Lets you read mailbox from POP server and use extracted letter's information in your JSP pages.

For example:
 


<%@ taglib uri="taglib.tld" prefix="pop" %>
<html>

<!-- open mail reader -->
<pop:POPreader user="user_name" password="your_password"
host="your_host" port="110">

<!-- how many letters we have -->
<pop:size id="A"/>
<%
out.println("You have:"+A.intValue()+" letters");
%>

<!-- print last letter -->
<pre>
<pop:letter num="<%=A%>" field="BODY"/>
</pre>

<!-- read 'From' field from the last letter -->
<pop:letter num="<%=A%>" field="FROM" id="B"/>
<br>From:<%=B%>

<!-- print 'Subject' and 'Date' from the last letter -->
<br>Subject:<pop:letter num="<%=A%>" field="SUBJECT"/>
<br>Date:<pop:letter num="<%=A%>" field="DATE"/>

<!-- delete last letter -->
<pop:delete num="<%=A%>"/>

<!-- how many letters we have now -->
You have: <pop:size/> letters

<!-- close mail reader -->
</pop:POPreader>
</html>

Tags are:

POPreader

Body tag. Defines POP context. Within this context you may read/delete letters. Parameters are:

1) host Describes mail host
2) port Optional parameter. Describes port. Default value is 110.
3) user User name
4) password Password

size

Counts letters. With parameter id creates pages scope variable. Type for this variable is Integer. Without this parameter tag just prints counter. Parameters are:

1) id Optional parameter. Describes page scope variable for data. Type is java.lang.Integer

delete

Deletes letter. Parameters are:

1) num Describes number for the letter

letter

Reads specified field from the given letter. With parameter id creates pages scope variable. Type for this variable is java.lang.String. Without this parameter tag just prints appropriate field. Fields you may read in the current version are: FROM, SUBJECT, DATE, BODY. Parameters are:

1) num Describes letter's number
1) field Describes letter's field
3) id Optional parameter. Describes page scope variable

attachments

Body tag. Reads attachments from the given letter. Within tag's body you may use page scope variables: Name - for file name, Path - for real file path, Size - for file size. Parameters are:

1) num Describes letter's number

For example let we print all attachments from first letter:

<pop:attachments num="1">
  <br>File:<%=Name%>
  <br>Real path:<%=Path%>
  <br>Size:<%=Size%> bytes
</pop:attachments>

for downloading:

Library: poptag.jar    Description: taglib.tld

 © Coldbeans      Comments?

See also Coldtags suite - the largest collection of custom JSP tags.