Java Reference
In-Depth Information
<tr><td
colspan
#
2><pre>
<%
#
content
%>
</pre>
<%
}
else
{
Multipart multi
#
(Multipart)content;
for
(
int
j
#
0; j<multi.getCount();
!!
j){
BodyPart part
#
multi.getBodyPart(j);
String type
#
part.getContentType();
content
#
part.getContent();
if
( content
instanceof
String){
%>
<tr><td><%
#
j
%><td>
<pre>
<%
#
content
%>
</pre>
<%
}
else
{
%>
<tr><td><%
#
j
%><td><%
#
type
%>
<%
} } }
%>
</table>
<%
}
catch
(Exception e){
%>
UbiMail encountered an error
while
accessing your
mailbox.
<p><tt><%
#
e
%></tt>
<%
}
%>
...
</body></html>
The end of the interaction with the system is carried out by
logout.jsp
. It
invalidates the session, with all the attributes it contains.
<%@
page contentType
#
"text/html" language
#
"java"
%>
<%
session.invalidate();
%>
<html><head><title>
UbiMail - Goodbye!
</title></head>
<body><h1>
UbiMail
</h1>
You just logged out!
<br>
To login again go to the
<a
href
#
"index.html"
>
login
page
</a>
.
<hr><i>
UbiMail - Ubiquitous e-mail system
</i>
</body></html>
16.3.4
Test
The test must check the main area of usage and some typical error con-
ditions. It is important to have a mail server that supports the POP protocol
with some email messages stored on it.
The main scenario to test is the following:
Open the
index.html
page.
■