Mail Received Authentication Complete Document
Mail Received Authentication Complete Document
INTRODUCTION
At present generation e-mail plays a prominent role. It is most used application for
communication through which we can send text messages, documents, images and files.
In present e-mail system we have only the facility of file sent notification. We don’t
know whether receiver has seen it or not. To know whether mail send or not we
proposed a system for message receipt facility.
Disadvantages
Our proposal system for message receipt facility when it is seen by the recipient,
so that sender is aware of the fact that his message has been read. This also displays the
time and date when the receiver opens the mail.
Advantages
Sender is aware of the fact that his message has been read.
This also displays the time and date when the receiver opens the mail.
1
1.3 Motivation
• At present generation e-mail plays a prominent role. It is most
used application for communication through which we can send
text messages , documents , images and files. In present e-mail
system we have only the facility of file sent notification.
1.4 Scope
1.5 Outline
CHAPTER 2
2
LITERATURE SURVEY
Literature survey is the most important step in software
development process. Before developing the tool it is necessary
to determine the time factor, economy n company strength.
Once these things r satisfied, ten next steps are to determine
which operating system and language can be used for developing
the tool. Once the programmers start building the tool the
programmers need lot of external support. This support can be
obtained from senior programmers, from book or from websites.
Before building the system the above consideration r taken into
account for developing the proposed system.
3
CHAPTER 3
SOFTWARE REQUIREMENT SPECIFICATIONS
3.1 Introduction
Purpose
This project is the college level project and is implementing under the guidance
of college professors. This project is useful to administrators who handle cluster of
systems. All the system are analyzed all at a time by using the evaluation mechanisms
which are carried out using the DMS.
Mainly intended for organizations and colleges. Administrator who can review
systems capabilities and more easily understand systems performance in a client server
network
4
Product Scope
Product Perspective
The mail receive authentication system will be a new web based system. It will
be implemented on client/server model network.
Product Function
This has an easy to use main menu, from which the rest of the features or
functions can be accessed. These main features as listed are: account login, composing
mail, checking sent mails and logout.
5
User Classes and Characteristics
Our application hopes to draw on two main user groups. The users and admin
have individual login id and password. The two main user groups are sender and
receiver.
1. User:
User can be a sender or receiver. Both the users must register and the
login to send or receive mail. The sender sends the mail to the receiver. The receiver
receives it and the acknowledgement is send to the sender.
2. Admin:
The admin can directly login into his account and he can view the users
and delete the users.
Operating Environment
Software Requirements
• Technology : Java
• Tool : NetBeans 8.1
Hardware Requirements
• Cache : 512MB
6
• Hard disk : More than 10GB
Login Screen This is for the Administrator to get into the application.
Admin Account This shows the all the information of all the systems.
New Registrations This activity or utility is to register new users or clients in the
server.
Modules
1. USER:
User can be a sender or receiver. Both the users must register and the login to
send or receive mail. The sender sends the mail to the receiver. The receiver receives it
and the acknowledgement is send to the sender.
2. ADMIN:
The admin can directly login into his account and he can view the users and delete the
users.
USER LOGIN:
The user provides the username and password. After the authentication, he gets access
to the mail.
SENDING MAIL:
The composed mail is sent to the receiver by providing the receiver email address.
RECEIVING MAIL:
7
The receiver receives the mail from the sender.
ACKNOWLEDGMENT:
Performance Requirements
CHAPTER 4
SYSTEM DESIGN
The purpose of the design phase is to plan a solution of the problem specified by
the requirement document. This phase is the first step in moving from the problem
domain to the solution domain. In other words, starting with what is needed, design
takes us toward how to satisfy the needs. The design of a system is perhaps the most
critical factor affection the quality of the software; it has a major impact on the later
phase, particularly testing, maintenance. The output of this phase is the design
document. This document is similar to a blueprint for the solution and is used later
8
during implementation, testing and maintenance. The design activity is often divided
into two separate phases System Design and Detailed Design.
System Design also called top-level design aims to identify the modules that
should be in the system, the specifications of these modules, and how they interact with
each other to produce the desired results. During, Detailed Design, the internal logic of
each of the modules specified in system design is decided. During this phase, the details
of the data of a module is usually specified in a high-level design description language,
which is independent of the target language in which the software will eventually be
implemented.
In system design the focus is on identifying the modules, whereas during
detailed design the focus is on designing the logic for each of the modules During the
system design activities, Developers bridge the gap between the requirements
specification, produced during requirements elicitation and analysis, and the system that
is delivered to the user.
UML Diagrams
9
Use Case Diagram For Sender
The sender interfaces with the application. The application here is mail receive
authentication system. To interface with the application sender has to enter the
username and password. After logging in, the sender can compose mail and get the
acknowledgement.
10
Use Case Diagram For Receiver
The receiver interfaces with the application. The application here is mail receive
authentication system. To interface with the application receiver has to enter the
username and password. After logging in, the receiver can check the mails.
11
Use Case Diagram For Admin :
The Admin interfaces with the application. To interface with the application admin has
to enter the username and password. After logging in, the admin can view or delete
users.
12
Class Diagram:
The class diagram above shows a hierarchy – a series of classes and their subclasses.
The first class is Register class which has attributes as first name, last name, email,
password, birthday, gender, mobile number and location. The operations are creating an
account and reset. Using association relationship, it is connected to login class, where
we have a common attribute: username and password. The operations are login. Using
dependency relationship three more classes named Sender, Receiver and Admin are
connected to the login class. The admin class has view and delete operations. Using
association relationship, it is connected to the Database class. The Receiver class has
inbox, all mail and logout operations. The Sender class has compose mail, sent mail, get
acknowledgement and logout operations. They both are connected to report class by
association relationship.
13
Sequence Diagram:
The figure above shows a sequence diagram that specifies the flow of control involved
in authenticating users and displaying the details. At this level of abstraction, the objects
involved are: sender, receiver and admin. The sequence begins with the logging in,
sending and receiving mails, getting acknowledgement and logout.
14
Activity Diagram :
The activity diagram starts from register, logging in, sending or checking mails, view or
delete users, getting acknowledgement and ends with logging out.
15
CHAPTER 5
IMPLEMENTATION
Implementation includes all those activities that take place to convert from the old
system to the new. The old system consists of manual operations, which is operated in a
very different manner from the proposed new system. A proper implementation is
essential to provide a reliable system to meet the requirements of the organizations. An
improper installation may affect the success of the computerized system.
// home page
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-
scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="../../docs-assets/ico/favicon.png">
16
<link href="assets/css/bootstrap.css" rel="stylesheet">
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="assets/js/hover.zoom.js"></script>
<script src="assets/js/hover.zoom.conf.js"></script>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and
media queries -->
<!--[if lt IE 9]>
<script
src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script
src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script
>
<![endif]-->
</head>
<body>
17
<button type="button" class="navbar-toggle" data-toggle="collapse"
data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">Mail Received
Authentication System</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="index.html">HOME</a></li>
<li><a href="newaccount.jsp">CREATE ACCOUNT</a></li>
<li><a href="accountlogin.jsp">LOGIN</a></li>
<li><a href="adminaccount.jsp">ADMIN</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
18
<p style=" font-size: 24px; text-align: justify;
padding-top: 5px;
/*padding-bottom: 600px;*/
font-style:italic;
margin-bottom:30px;
margin-left: 15px;
margin-right: 15px;
color: black;
line-height: 40px;
/* font-weight: 500px;*/
</font>
</p>
</div><!-- /col-lg-8 -->
</div><!-- /row -->
19
</div> <!-- /container -->
</div><!-- /ww -->
<script src="assets/js/bootstrap.min.js"></script>
</body>
</html>
// Accountlogin.jsp
<%--
Document : newaccount
Created on : Jun 22, 2017, 10:38:47 AM
Author : VENKAT
--%>
<%String msg=request.getParameter("msg");%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-
scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="../../docs-assets/ico/favicon.png">
20
<!-- Bootstrap core CSS -->
<link href="assets/css/bootstrap.css" rel="stylesheet">
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="assets/js/hover.zoom.js"></script>
<script src="assets/js/hover.zoom.conf.js"></script>
<script type="text/javascript">
function validate()
{
var c=document.reg.email.value;
var d=document.reg.password.value;
if (c.indexOf("@gmail", 0) < 0)
{
alert("Please enter a valid e-mail address. Like @gmail");
document.reg.email.focus();
return false;
}
21
if (c.indexOf(".", 0) < 0)
{
alert("Please enter a valid e-mail address.");
document.reg.email.focus();
return false;
}
return true;
}
</script>
</head>
<body>
22
<li><a href="index.html">HOME</a></li>
<li><a href="newaccount.jsp">CREATE ACCOUNT</a></li>
<li><a href="accountlogin.jsp">LOGIN</a></li>
<li><a href="adminaccount.jsp">ADMIN</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<tr><td>Email-ID</td><td><input type="text"
name="email"required placeholder="Choose Mail Id "></td></tr>
23
<tr><td>Choose Password</td><td><input
type="password" name="password"required placeholder="Choose
Password"></td></tr>
</table>
</form>
</div><!-- /col-lg-8 -->
</div><!-- /row -->
</div> <!-- /container -->
</div><!-- /ww --
<script src="assets/js/bootstrap.min.js"></script>
</body>
</html>
<%--
Document : useraccount
Created on : Jun 22, 2017, 12:00:58 PM
Author : VENKAT
--%>
24
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-
scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="../../docs-assets/ico/favicon.png">
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="assets/js/hover.zoom.js"></script>
<script src="assets/js/hover.zoom.conf.js"></script>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and
media queries -->
<!--[if lt IE 9]>
25
<script
src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script
src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script
>
<![endif]-->
</head>
<body>
<li><a href="adminhome.jsp">HOME</a></li>
26
<li><a href="viewusers.jsp">VIEW USERS</a></li>
<li><a href="deleteusers.jsp">DELETE USERS</a></li>
<li><a href="index.html">LOGOUT</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<div class="row">
<div class="col-lg-8 col-lg-offset-2 centered">
<p></p>
</div><!-- /col-lg-8 -->
</div><!-- /row -->
</div> <!-- /container -->
</div><!-- /ww -->
27
<script src="assets/js/bootstrap.min.js"></script>
</body>
</html>
// create account.jsp
<%--
Document : createaccount
Created on : Jun 22, 2017, 11:28:37 AM
Author : VENKAT
--%>
<%@page import="java.sql.*"%>
<%
String fname=request.getParameter("fname");
String lname=request.getParameter("lname");
String email=request.getParameter("email");
String password=request.getParameter("password");
String cpassword=request.getParameter("cpassword");
String birthday=request.getParameter("birthday");
String gender=request.getParameter("gender");
String mobile=request.getParameter("mobile");
String location=request.getParameter("location");
int count=0;
try
28
{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/email","r
oot","root");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select count(*) from newaccount
where email='"+email+"'");
if(rs.next())
{
count=rs.getInt(1);
if(count==0)
{
int i=st.executeUpdate("insert into newaccount
values('"+fname+"','"+lname+"','"+email+"','"+password+"','"+cpassword+
"','"+birthday+"','"+gender+"','"+mobile+"','"+location+"',now())");
if(i==0)
{
response.sendRedirect("newaccount.jsp?msg=failure");
}
else
{
response.sendRedirect("newaccount.jsp?msg=Account
Created Suceesfully");
}
}
else
{
29
response.sendRedirect("newaccount.jsp?msg=User Already Exists
For This email-Id");
}
}
}
catch(Exception e)
{
out.println(e);
}
%>
5.2 Methodologies
INTRODUCTION TO JAVA
About Java:
Initially the language was called as “oak” but it was renamed as “java” in 1995.The
primary motivation of this language was the need for a platform-independent(i.e.
architecture neutral)language that could be used to create software to be embedded
in various consumer electronic devices.
30
Java has had a profound effect on the Internet. This is because; java expands the
Universe of objects that can move about freely in Cyberspace. In a network, two
categories of objects are transmitted between the server and the personal computer.
They are passive information and Dynamic active programs. in the areas of Security
and probability. But Java addresses these concerns and by doing so, has opened the
door to an exciting new form of program called the Applet.
An application is a program that runs on our Computer under the operating system
of that computer. It is more or less like one creating using C or C++ .Java’s ability to
create Applets makes it important. An Applet I san application, designed to be
transmitted over the Internet and executed by a Java-compatible web browser. An
applet I actually a tiny Java program, dynamically downloaded across the network,
just like an image. But the difference is, it is an intelligent program, not just a media
file. It can be react to the user input and dynamically change.
Java Architecture
Compilation of code
When you compile the code, the Java compiler creates machine code (called byte
code)for a hypothetical machine called Java Virtual Machine(JVM). The JVM is
supposed t executed the byte code. The JVM is created for the overcoming the issue
31
of probability. The code is written and compiled for one machine and interpreted on
all machines .This machine is called Java Virtual Machine.
Java
Pc Java Byte interpreter
compiler code
Java
Macintosh interpreterm
compiler Platform
Source acintosh
independ
code ent
SPARC Java
Compiler interpreter(
SPARC)
During run-time the Java interpreter tricks the byte code file into thinking that it is
running on a Java Virtual Machine. In reality this could be an Intel Pentium
windows 95 or sun SPARCstation running Solaris or Apple Macintosh running
system and all could receive code from any computer through internet and run the
Applets. )))
Simple:
Java was designed to be easy for the Professional programmer to learn and to use
effectively. If you are an experienced C++ Programmer. Learning Java will oriented
features of C++ . Most of the confusing concepts from C++ are either left out of
Java or implemented in a cleaner, more approachable manner. In Java there are a
small number of clearly defined ways to accomplish a given task.
32
Object oriented
Java was not designed to be source-code compatible with any other language. This
allowed the Java team the freedom to design with a blank state. One outcome of this
was a clean usable, pragmatic approach to objects. The object model in Java is
simple and easy to extend, while simple types, such as integers, are kept as high-
performance non-objects.
Robust
The multi-platform environment of the web places extraordinary demands on a
program, because the program must execute reliably in a variety of systems. The
ability to create robust programs. Was given a high priority in the design of Java.
Java is strictly typed language; it checks your code at compile time and runtime.
Java virtually eliminates the problems of memory management and deal location,
which is completely automatic. In a well-written Java program, all run-time errors
can and should be managed by your program.
4.4.2 Servlets/JSP
INTRODUCTION
A servlet is similar to proprietary server extension, except that it runs inside a Java
Virtual Machine (JVM) on the server, so it is safe and portable
33
Unlike CGI and Fast CGI, which use multiple processes to handle separate program
or separate requests, separate threads within web server process handle all servlets.
This means that servlets are all efficient and scalable.
Servlets are portable; both across operating systems and also across web servers.
Java Servlets offer the best possible platform for web application development.
Servlets are used as replacement for CGI scripts on a web server, they can extend
any sort of server such as a mail server that allows servelts t extend its functionality
perhaps by performing a virus scan on all attached documents or handling mail
filtering tasks.
Servlets are objects that conform to a specific interface that can be plugged into a
Java-based server.Servlets are to the server-side what applets are to the server-side
what applets are to the client-side-object byte codes that can be dynamically loaded
off the net. They differ form applets in than they are faceless objects(with out
graphics or a GUI component).They serve as platform independent, dynamically
loadable,plugable helper byte code objects on the server side that can be used to
dynamically extend server-side functionality.
For example an HTTP servlet can be used to generate dynamic HTML content when
you use servlets to do dynamic content you get the following advantages:
34
They use a standard API( the servlet API)
They provide all the advantages of Java (run on a variety of servers without
needing to be rewritten)
A t t r a c t i v e n e s s o f S e r v l e t s:
They are many features of servlets that make them easy and attractive to tuse these
include:
One of the great advantages of the servlet API is protocol independent. It assumes
nothing about:
35
Features of Servlets:
Servlets are persistent.Servlet are loaded only by the web server and can
maintain services between requests.
Servlets are fast. Since servlets only need to be l\loaded once, they offer
much better performance over their CGI counterparts.
Servlets are platform independent.
Servlets are extensible Java is a robust, object-oriented programming
language, which easily can be extended to suit your needs.
Servlets are secure
Servlets are used with a variety of client.
Servlets are classes and interfaces from tow packages,javax .servlet and
javax.servlet.http.The java.servlet package contains classes t support generic,
protocol-independent servlets.The classes in the javax.servelt.http package To and
HTTP specific functionality extend these classes
Unlike a java program, a servlet does not have a main() method,Instead the server in
the process of handling requests invoke certain methods of a servlet.Each time the
server dispatches a request to a servlet, it invokes the servelts Service() method,
36
a response object .The request object tells the servlet about the request, while the
response object is used to return a response
Loading Servlets:
Servlets can be loaded from their places. From a directory that is on the
CLASSPATH. The CLASSPATH of the JavaWebServer includes service
root/classes/, which is where the system classes reside
37
Loading Remote Servlets
A servlet invoker is a servlet that invokes the “server” method on a named servlet.If
the servlet is not loaded in the server,then the invoker first loades the servlet(either
form local disk or from the network) and the then invokes the “service”
method.Also like applets,local servlets in the server can be identified by just the
class name.In other words, if a servlet name is not absolute.it is treated as local.
The client can ask for a document that is served by the servlet.
The client(browser) can invoke the servlet directly using a URL, once it
has been mapped using the SERVLET ALIASES Section of the admin
GUI
The servlet can be invoked through server side include tags.
The servlet can be invoked by placing it in the servlets/directory
The servlet can be invoked by using it in a filter chain
The Servlet Life Cycle:-
38
The Servlet life cycle is one of the most exciting features of Servlets.This life cycle
is a powerful hybrid of the life cycles used in CGI programming and lower-level
NSAPI and ISAPI programming.
The servlet life cycle allows servlet engines to address both the performance and
resource problems of CGI and the security concents of low level server API
programming.
Servlet life cycle is highly flexible Servers hava significant leeway in how they
choose to support servlets.The only hard and fast rule is that a servlet engine must
confor to the following life cycle contact:
It’s perfectly legal for a servlet t be loaded, created an initialzed in its own
JVM,only to be destroyed an dgarbage collected without hancdling any clientrequest
or after handling just one request
The most common and most sensible life cycle implemntations for HTTP servelts
are:
39
Just like Applets servlets can define init() and destroy() methods, A servlets
init(ServiceConfig) method is called by the server immediately after the server
constructs the servlet’s instance.Depanding on the server and its configuration, this
can be at any of these times
In any case, nit() is guaranteed to be called before the servlet handles its first request
This ServletConfig object supplies a servlet with information about its initialization
parameters.These parameters are given to the servlets and are not associated with
any single request.They can specify initial values, such as where a counter should
begin counting, or default values, perhaps a template to use when not specified by
the request,
The server calls a servlet’s destroy() method when the servlet is about to be
unloaded. In the destroy() method, a servlet should free any resources it has
acquired that will not be garbage collected. The destroy() method also gives a
servlet a chance to write out its unsaved. cached information or any persistent
information that should be read during the next call to init().
40
Session Tracking:
The solution for this is for client to introduce itself as it makes each request, Each
clients needs to provide a unique identifier that lets the server identify it, or it needs
to give some information that the server can use to properly handle the request,
There are several ways to send this introductory information with each request Such
as:
USER AUTHORIZATION:
One way to perform session tracking is to leverage the information that comes with
User authorization. When a web server restricts access to some of its resources to
only those clients that log in using a recognized username and password. After the
client logs in, the username is available to a servlet through getRemoteUser ()
Wean use the username to track the session. Once a user has logged in, the browser
remembers her username and resends the name and password as the user views new
pages on the site. A servlet can identify the user through her username and they’re
by
The biggest advantage of using user authorization to perform session tracking is that
it’s easy to implement. Simply tell the protect a set of pages, and use
getRemoteUser() to identify each client.Another advantage is that the technique
works even when the user accesses your site form or exists her browser before
coming back.
41
The biggest disadvantage of user authrization is that it requires each user to register
for an account and then log in in each time the starts visiting your site. Most users
will tolerate registering and lagging in as a necessary evil when they are accessing
sensitive information, but its all overkill for simple session tracking.Other problem
with user authorization is that a user cannot simultaneously maintain more than one
session at the same site.
One way to support anonymous session tracking is to use hidden from fields. As the
name implies, these are fields added to an HTML, form that are not displayed in the
client’s browser, They are sent back to the server when the form that contains them
is submitted.
In a sense, hidden form fields define constant variables for a form. To a servlet
receiving a submitted form, there is no difference between a hidden fields and a
visible filed.
As more and more information is associated with a clients session . It can become
burdensome to pass it all using hidden form fields. In these situations it’s possible to
pass on just a unique session ID that identifies as particular clients session.
That session ID can be associated with complete information about its session that is
stored on the server.
The advantage of hidden form fields is their ubiquity and support for anonymity.
Hidden fields are supported in all the popular browsers, they demand on special
server requirements, and they can be used with clients that haven’t registered or
logged in.
The major disadvantage with this technique, however is that works only for a
sequence of dynamically generated forms, The technique breaks down immediately
with static documents, emailed documents book marked documents and browser
shutdowns.
URL Rewriting:
42
URL rewriting is another way to support anonymous session tracking, With URL
rewriting every local URL the user might click on is dynamically modified. or
rewritten, to include extra, information. The extra information can be in the deform
of extra path information, added parameters, or some custom, server-specific.URL
change. Due to the limited space available in rewriting a URL, the extra information
is usually limited to a unique session.
Using extra path information works on all servers, and it works as a target for forms
that use both the Get and Post methods. It does not work well if the servlet has to
use the extra path information as true path information
Persistent Cookies:
The biggest problem with cookies is that browsers don’t always accept cookies
sometimes this is because the browser doesn’t support cookies. More often its
because
43
The browser doesn’t support cookies. More often its because the user has
specifically configured the browser to refuse cookies.
The power of servlets is nothing but the advantages of servlets over other
approaches, which include portability, power, efficiency, endurance, safety
elegance, integration, extensibility and flexibility.
Portability:
As servlets are written in java and conform to a well defined and widely accepted
API.they are highly portable across operating systems and across server
implementation
We can develop a servlet on a windows NT machine running the java web server
and later deploy it effortlessly on a high-end Unix server running apache. With
servlets we can really “write once, serve every where”
Servlet portability is not the stumbling block it so often is with applets, for two
reasons
First,Servlet portability is not mandatory i.e. servlets has to work only on server
machines that we are using for development and deployment
Second, servlets avoid the most error-prone and inconstancy implemented portion of
the java languages.
Power:
Servlets can harness the full power of the core java. API’s: such as Networking and
Url access, multithreading, image manipulation, data compression, data base
connectivity, internationalization, remote method invocation(RMI) CORBA
connectivity, and object serialization, among others,
44
begin handling the request almost immediately, Multiple, concurrent requests are
handled the request almost immediately. Multiple, concurrent requests are handled
by separate threads, so servlets are highly scalable.
Servlets in general are enduring objects. Because a servlets stays in the server’s
memory as a single object instance. it automatically maintains its state and can hold
onto external resources, such as database connections.
Safety:
As they are written in java,servlets inherit the strong type safety of the java
language. In addition the servlet API is implemented to be type safe. Java’s
automatic garbage collection and lack of pointers mean that servlets are generally
safe from memory management problems like dangling pointers invalid pointer
references and memory leaks.
Servlets can handle errors safely, due to java’s exception – handling mechanism. If a
servlet divides by zero or performs some illegal operations, it throws an exception
that can be safely caught and handled by the server.
A server can further protect itself from servlets through the use of java security
manager.A server can execute its servlets under the watch of a strict security
manager.
Elegance:
The elegance of the servlet code is striking .Servlet code is clean, object oriented
modular and amazingly simple one reason for this simplicity is the served API itself.
Which includes methods and classes to handle many of the routine chores of servlet
development. Even advanced to operations like cookie handling and session
tracking tracking are abstracted int convenient classes.
Integration:
Servlets are tightly integrated with the server. This integration allows a servlet to
cooperate with the server in two ways . for e.g.: a servlet can use the server to
45
translate file paths, perform logging, check authorization, perform MIME type
mapping and in some cases even add users to the server’s user database.
The servlet API is designed to be easily extensible. As it stands today the API
includes classes that are optimized for HTTP servlets.But later it can be extended
and optimized for another type of servlets.It is also possible that its support for
HTTP servlets could be further enhanced.
Servlets are also quite flexible, Sun also introduced java server pages. which offer a
way to write snippets of servlet code directly with in a static HTML page using
syntax similar to Microsoft’s Active server pages(ASP)
4.4.3 JDBC
What is JDBC?
any relational database. One can write a single program using the JDBC API,and the
JDBC is a Java Api for executing SQL,Statements(As a point of interest JDBC is
trademarked name and is not an acronym; nevertheless,Jdbc is often thought of as
standing for Java Database Connectivity. It consists of a set of classes and interfaces
written in the Java Programming language.JDBC provides a standard API for
tool/database developers and makes it possible to write database applications using a
pure Java API
Using JDBC, it is easy to send SQL statements to virtually program will be able to
send SQL .statements to the appropriate database. The Combination of Java and
JDBC lets a programmer writes it once and run it anywhere.
46
o Establish a connection with a database
o Send SQL statements
o Process the results
o JDBC Driver Types
o The JDBC drivers that we are aware of this time fit into one of four categories
o JDBC-ODBC Bridge plus ODBC driver
o Native-API party-java driver
o JDBC-Net pure java driver
o Native-protocol pure Java driver
An individual database system is accessed via a specific JDBC driver that
implements the java.sql.Driver interface. Drivers exist for nearly all-popular
RDBMS systems, through few are available for free. Sun bundles a free JDBC-
ODBC bridge driver with the JDK to allow access to a standard ODBC,data sources,
such as a Microsoft Access database, Sun advises against using the bridge driver for
anything other than development and very limited development.
JDBC drivers are available for most database platforms, from a number of vendors
and in a number of different flavours. There are four driver categories
Type 02 drivers wrap a thin layer of java around database-specific native code
libraries for Oracle databases, the native code libraries might be based on the
OCI(Oracle call Interface) libraries, which were originally designed for c/c++
programmers, Because type-02 drivers are implemented using native code. in some
47
cases they have better performance than their all-java counter parts. They add an
element of risk, however, because a defect in a driver’s native code section can
crash the entire server
Type o4 drivers are the most direct of the lot. Written entirely in java, Type 04
drivers understand database-specific networking. protocols and can access the
database directly without any additional software
JDBC-ODBC Bridge
If possible use a Pure Java JDBC driver instead of the Bridge and an ODBC driver.
This completely eliminates the client configuration required by ODBC.It also
eliminates the potential that the Java VM could be corrupted by an error in the
native code brought in by the Bridge(that is, the Bridge native library, the ODBC
driver manager library, library, the ODBC driver library, and the database client
library)
48
The JDBC-ODBC Bridge is a Jdbc driver, which implements JDBC operations by
translating them into ODBC operations. To ODBC it appears as a normal application
program. The Bridge is implemented as the sun.jdbc.odbc Java package and contains a
native library used to access ODBC.The Bridge is joint development of Intersolv and
Java Soft
4.4.4 Oracle
Oracle is a relational database management system, which organizes data in the form of
tables. Oracle is one of many database servers based on RDBMS model, which manages
a seer of data that attends three specific things-data structures, data integrity and data
manipulation.
With oracle cooperative server technology we can realize the benefits of open,
relational systems for all the applications. Oracle makes efficient use of all systems
resources, on all hardware architecture; to deliver unmatched performance, price
performance and scalability. Any DBMS to be called as RDBMS has to satisfy
Dr.E.F.Codd’s rules.
Features of Oracle:
Portable
The Oracle RDBMS is available on wide range of platforms ranging from PCs
to super computers and as a multi user loadable module for Novel NetWare, if you
develop application on system you can run the same application on other systems
without any modifications.
Compatible
Oracle commands can be used for communicating with IBM DB2 mainframe
RDBMS that is different from Oracle, which is Oracle compatible with DB2. Oracle
49
RDBMS is a high performance fault tolerant DBMS, which is specially designed for
online transaction processing and for handling large database applications.
Oracle has become the most popular RDBMS in the market because of its ease of use
Client/server architecture.
Data independence.
Ensuring data integrity and data security.
Managing data concurrency.
Parallel processing support for speed up data entry and online transaction
processing used for applications.
DB procedures, functions and packages.
Dr.E.F.Codd’s Rules
These rules are used for valuating a product to be called as relational database
management systems. Out of 12 rules, a RDBMS product should satisfy at least 8 rules
+ rule called rule 0 that must be satisfied.
50
RULE 2: Guaranteed Access
Null values are supported for representing missing information and inapplicable
information. They must be handled in systematic way, independent of data types.
The database description is represented at the logical level in the same way as
ordinary data so that authorized users can apply the same relational language to its
interrogation as they do to the regular data.
Any view that is theoretical can be updatable if changes can be made to the
tables that effect the desired changes in the view.
51
RULE 7: High level Update, Insert and Delete
Whether or not a system supports database distribution, it must have a data sub-
language that can support distributed databases without changing the application
program.
If a relational system has low level language, that low language cannot use to
subversion or by pass the integrity rules and constraints expressed in the higher level
relational language.
52
Rule 2: Guaranteed Access-YES.
4.4.5 HTML
Specialized to hypertext and adapted to the Web. The idea behind Hypertext one
point to another point. We can navigate through the information based on out
interest and preference. A markup language is simply a series of items enclosed
within the elements should be displayed.
53
Html can be used to display any type of document on the host computer, which can
be geographically at a different location. It is a versatile language and can be used
on any platform or desktop
A D V A N T A G E S:-
A HTML document is small and hence easy to send over the net.It is
small because it does not include formatted information.
54
HTML is platform independent
HTML tags are not case-sensitive.
For example, you can write a JavaScript function to verify that users enter valid
information into a form requesting a telephone number or zip code . Without any
network transmission, an Html page with embedded Java Script can interpret the
entered text and alert the user with a message dialog if the input is invalid or you
can use JavaScript to perform an action (such as play an audio file, execute an
applet, or communicate with a plug-in) in response to the user opening or exiting a
page.
CHAPTER 6
TESTING
6.1Importance Of Testing
Testing is a process, which reveals errors in the program. It is the major quality
measure employed during software development. During software development.
55
During testing, the program is executed with a set of test cases and the output of the
program for the test cases is evaluated to determine if the program is performing as it is
expected to perform.
TESTING IN STRATEGIES
In order to make sure that the system does not have errors, the different levels
of testing strategies that are applied at differing phases of software development
are:
Unit Testing:
Unit Testing is done on individual modules as they are completed and become
executable. It is confined only to the designer's requirements.
In this strategy some test cases are generated as input conditions that fully
execute all functional requirements for the program. This testing has been uses to
find errors in the following categories:
56
White Box testing :
In this the test cases are generated on the logic of each module by drawing
flow graphs of that module and logical decisions are tested on all the cases. It has
been uses to generate the test cases in the following cases:
System Testing:
Involves in-house testing of the entire system before delivery to the user. It's aim
is to satisfy the user the system meets all requirements of the client's
specifications.
Acceptance Testing :
Test Approach :
Testing can be done in two ways:
Bottom up approach
Top down approach
57
Bottom up Approach:
Testing can be performed starting from smallest and lowest level modules
and proceeding one at a time. For each module in bottom up testing a short
program executes the module and provides the needed data so that the module is
asked to perform the way it will when embedded with in the larger system. When
bottom level modules are tested attention turns to those on the next level that use
the lower level ones they are tested individually and then linked with the
previously examined lower level modules.
This type of testing starts from upper level modules. Since the detailed
activities usually performed in the lower level routines are not provided stubs are
written. A stub is a module shell called by upper level module and that when
reached properly will return a message to the calling module indicating that proper
interaction occurred. No attempt is made to verify the correctness of the lower level
module.
Validation:
The system has been tested and implemented successfully and thus ensured that all
the requirements as listed in the software requirements specification are completely
fulfilled. In case of erroneous input corresponding error messages are displayed.
CHAPTER 7
RESULTS
HOMEPAGE
58
REGISTRATION PAGE
SUCCESSFUL PAGE
59
ACCOUNT LOGIN PAGE
60
COMPOSE MAIL
INBOX
61
CHECKING MAILS
SENT MAILS
62
ALL MAILS
RECEIVER’S HOMEPAGE
63
INBOX
CHECKING MAIL
64
ACKNOWLEDGEMENT
ADMIN LOGIN
65
ADMIN HOMEPAGE
66
DELETE USERS PAGE
67
CHAPTER 8
By using this project sender is aware of the fact that his message has been
read.
This also displays the time and date when the receiver opens the mail.
Future Scope
BIBLIOGRAPHY
JAVA Technologies
68
J2EE Professional by Shadab siddiqui
HTML
JDBC
69