Java Reference
In-Depth Information
<html><head><title>UbiMail -
<% # user%>'s details</title></head>
Hello <% # user%>.
<h2>User details</h2>
Please provide the details for your POP server.
<form method # "POST" action # "main.jsp">
<tr><td>POP server:
<td><input type # text name # "popServer" size # 30>
<tr><td>POP user:
<td><input type # text name # "popUser" size # 30>
<tr><td>POP password:
<td><input type # password name # "popPass" size # 30>
<tr><td colspan # 2 align # center>
<input type # submit value # "Enter">
<i>UbiMail - Ubiquitous e-mail system</i>
The core of the application is main.jsp . If this is the first invocation of this
JSP in the session, it starts a new mail session, connects to the server and
opens the default message folder. Otherwise it recovers the mail objects
stored in the session attributes. This page builds a table and for each
message in the folder adds a row containing the subject, the sender and the
date of the message. Each message has a number that is a link to the JSP that
shows the contents; the URL has an additional ?index # n where n is the
number of the message. This is the standard way of passing parameters. To
make reading a long list of messages easier the rows alternate a light blue and
a pink background.
<%@ page contentType # "text/html" language # "java" %>
<%@ page import # "javax.mail.*, java.util.Properties,
java.util.Enumeration" %>
<% if (session.isNew()){
return ;
String user # (String) session.getAttribute("user");
Folder folder # (Folder) session.getAttribute("folder");
<html><head><title> UbiMail -
<% # user %> 's mailbox </title></head>
Search WWH ::

Custom Search