0% found this document useful (0 votes)
172 views

1.1. System Overview:: The Proposed System J-SHOP Has Developed To Provide The Several

The document describes the J-SHOP online shopping system. It provides an overview of the system and its goals of making online shopping easy and fast for customers. The proposed system allows customers and merchants to register and login. It provides features for merchants to add, edit, and delete products for sale. Customers can place orders and merchants can process orders. The system aims to provide benefits to both customers and merchants through an online shopping platform.

Uploaded by

Girish Bhagavath
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
172 views

1.1. System Overview:: The Proposed System J-SHOP Has Developed To Provide The Several

The document describes the J-SHOP online shopping system. It provides an overview of the system and its goals of making online shopping easy and fast for customers. The proposed system allows customers and merchants to register and login. It provides features for merchants to add, edit, and delete products for sale. Customers can place orders and merchants can process orders. The system aims to provide benefits to both customers and merchants through an online shopping platform.

Uploaded by

Girish Bhagavath
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 77

J-SHOP

1. INTRODUCTION

1.1. System Overview:

The proposed system J-SHOP has developed to provide the several


features to the users like, customer and merchant. The users of the system must login for
accessing many features. In this fast world of Science and Technology, everything is fast
and easy. J-SHOP is an effort to make the online shopping easy and fast. Using this
application you can give order for purchasing different items or goods through the
internet easily without going to the shop physically. J-SHOP will also provide a GUI
interface to all the customers of different countries and different regions. So user can
access the system from any where in the world. By using this application two categories
of people like merchant and customer will get the benefits.

1
CSE, MITS, 2008
J-SHOP

2. SYSTEM ANALYSIS
2.1. Existing System
In the existing system the work which is carried out manually and
personally by the Customers, which is time consuming and which have other effects on
the growth of the business. To overcome the above mention problems the project named
as J-SHOP has developed.

2.2. Proposed System


By using this application whatever work have to do , can be performed by
using any new technologies like LAN, Intranet and Internet from any where through out
the world and later the customer authentication will be provided to them. Through the
customer authentication, customers can enjoy the features that are provided in it.

In this fast world of Science and Technology, everything is fast and easy.
J-SHOP is an effort to make the online shopping easy and fast. Using this application
you can give order for purchasing different items or goods through the internet easily
without going to the shop. J-SHOP will also provide a GUI interface to all the
Customers of different countries and different regions. By using these application two
categories of people like merchant and customer will get the benefits.

2.3 FEASIBILITY STUDY


Every project is feasible if given unlimited resources and definite time.
Unfortunately, the development of a computer based system is more likely to be plague
by a scarcity of resources and difficulty delivery dates. It is both necessary and prudent to
evaluate the feasibility of a project at the earliest possible time. Months or years of effort,
thousands of lakhs of rupees and unfold professional embarrassment can be averted if an
ill-conceived system is recognized early in the definition phase. To avoid this details
study was carried out to check workability of the proposed system.

2
CSE, MITS, 2008
J-SHOP

Feasibility study is a test of systems proposed regarding its workability, impact on


the organization ability to meet user needs and effective use or resources. Thus when a
new application is proposed, it normally goes through a feasibility study before it is
approved for development. Feasibility and risk analysis are related in many ways. If
project risk is great, the feasibility of producing quality software is reduced.

TECHNICAL FEASIBILITY:
A study of resource availability may affect to achieve an acceptable system. The
technical feasibility is frequently the most difficulty area to ensure at this stage, because
objective, functions and performance are somewhat clear anything is possible if the right
assumptions are made. It is essential that the process of analysis and definition can be
conducted in parallel with an assessment of technical feasibility includes resources
availability of the organization, where the project is to be developed and implemented.
By taking these into consideration before developing, the resources availability at this
company was observed. Indeed J-SHOP is a shop that has enough resources (machine
and manpower) to develop any kind of the project for its use and as well as to shop that
has a product. Thus, this project is consideration technically feasible for development.

ECONOIMICAL FEASIBILITY:
An evolution of development cost weighted against the unlimited income or
benefit derived from the developed system. Economically justification is generally the
“Bottom line” consideration of most systems. Economic justification includes a broad
range of concerns that include cost benefit analysis. Cost-Benefit analysis delineates costs
for project development and weights them against tangible and intangible benefits of
system. Regarding the cost and benefits, the project, which is to be developed and
implemented, will give benefits to the shop in terms of man hours when compared to man
hours that are required to record data. It is seen that there is no need of extra hardware
and software for development of this project. Thus this project work is economically
feasible for development in this shop.

3
CSE, MITS, 2008
J-SHOP

OPERATIONAL FEASIBILITY:
Operation feasibility is a consideration about the working of the system after
the installation in the shop. The shop as mentioned in the feasibility analysis has ready
developed, installed many software products. The shop will use this system to maintain
the recruitment of employees.

2.4 Data Flow Diagrams


Data flow diagram is a structure analysis tool that is used for graphical
representation of Data processes through any organization. The data flow approach
emphasis on the logic underlying the system, by using combination of only 4 symbols. It
follows a top down approach. A full description of a system actually consists of set of
DFD s, which comprises of various levels. And initial over view model is exploded lower
level diagrams that show additional feature of the system. Further each process can be
broken down into a more detailed DFD. This occurs repeatedly until sufficient details are
described.

DFD symbols
Square

It defines a source (originator) or destination of system data.


Arrow

It indicates data flow-data in motion. It is a pipeline through which information


flows.

4
CSE, MITS, 2008
J-SHOP

Circle or Bubble

It represents a process that transforms incoming data flow(s) to outgoing data


flow(s).

Open Rectangle

It is a data store-data at rest, or a temporary repository of data.

Context Level

Merchant Merchant
J-SHOP

Customer Customer

5
CSE, MITS, 2008
J-SHOP

Level – 1

1 Login Id
Customer
Id, Pwd, Name, Register
Customer Customer
Mobile Number

Customer

2
Id, Pwd Login Options
Customer Customer

Customer

6
CSE, MITS, 2008
J-SHOP

3
Product Id, Add Product Cost
Customer Customer
Quantity

Product, OrderTab, Order_Product

4
Product Id, Edit Product Cost
Customer Customer
Quantity

Product, OrderTab, Order_Product

5
Product Id Delete Product Cost
Customer Customer

OrderTab, Order_Product

7
CSE, MITS, 2008
J-SHOP

6
Communication Place Order Confirmation
Customer Customer
Address

Transact

7
Order Number Process Order Confirmation
Merchant Merchant

Order_Product

8
CSE, MITS, 2008
J-SHOP

2.5. Software and Hardware requirement specifications

Software Requirements:

 Jdk 1.4, Jsdk2.0


 ODBC Drivers installed
 JDBC Drivers installed
 Apache Web Server
 Oracle 8i or later
 Windows 2000

Hardware Requirements:

 Pentium-IV Processor
 40GB Hard Disk space
 256MB RAM

9
CSE, MITS, 2008
J-SHOP

SYSTEM DESIGN

UML DIAGRAMS:
The Unified Modeling Language is a standard language for specifying,
visualizing, constructing and documenting the software system and its components. It is a
graphical language, which provides a vocabulary and set of semantics and rules. The
UML focuses on the conceptual and physical representation of the system. It captures the
decisions and understandings about systems that must be constructed. It is used to
understand, design, configure, maintain and control information about the systems.

VISUALIZING:
Through UML we see or visualize on existing system and ultimately we
visualize how the system is going to be after implementation. Unless we think we cannot
implement. UML helps to visualize how the components of the system communicate and
interact with each other.

SPECIFYING:
Specifying means building models that are precise, unambiguous and complete.
UML addresses the specification of all the important Analysis, Design, Implementation
decisions that must be made in developing and deploying a software system.

CONSTRUCTING:
UML models can be directly connected to a variety of programming language
through mapping a model from UML to a programming language like java or c++ or VB.
Forward and reverse Engineering is possible through UML.

10
CSE, MITS, 2008
J-SHOP

DOCUMENTING:
The deliverables of a project apart from coding are some artifacts which are
critical in controlling, measuring and communicating about a system during its
development viz. requirements, architecture, design, source code, project plans, tests,
prototypes, releases etc.

Class Diagram:

Fig. Class Diagram

11
CSE, MITS, 2008
J-SHOP

Use Case Diagram:

12
CSE, MITS, 2008
J-SHOP

Fig. Use Case Diagram for Customer

13
CSE, MITS, 2008
J-SHOP

Fig. Use Case Diagram for Merchant

14
CSE, MITS, 2008
J-SHOP

4. IMPLEMENTATION

4.1. Module Description


The two main modules of the system are,

1. Merchant and
2. Customer
1. Merchant:
This module will provide an easy and simple method of updating information
into the database related to the items and categories present in the shop. It includes:
 Creating new categories
 Editing the exiting categories
 Deleting the existing categories
 Adding new items to the store
 Editing the details of the existing items from the store
 Deleting the existing items from the store

Creating new categories:


This module deals with adding a new item type into the store, which
will contain many numbers of items. Once the merchant adds a type to the store, the
type will be displayed whenever the merchants want to add a new item. They can select
the required category and insert the item into it.
Editing the existing categories:
This module facilitates the merchants to change the details about the
existing category. Here the merchant will select a category and can change the name as
well as the description of the category.
Deleting the existing categories:
When no products are there in a category, the category will become an
unnecessary thing. This module facilitates the merchants to delete the existing category.
Here the merchant will select a category and go for deletion.
15
CSE, MITS, 2008
J-SHOP

Adding new items to the store:


This module deals with adding a new item into the store. Once the
merchant adds an item to the store, the product will be displayed whenever the customers
want to add an item to the order. They can select the required item and add the item to
the order.

Editing the details of the existing items from the store:


This module facilitates the merchants to change the details about the
existing product. Here the merchant will select a product and can change the name.

Deleting the existing items from the store:


When any customer did not select the product for a number of days, the
product will become an unnecessary thing. This module facilitates the merchants to
delete the existing product. Here the merchant will select a product and go for deletion.
2. Customer:
This module will provide an easy method to the customers to select the
items from the store and order the items.Here, the options offered to the User are,

 Check items present in the store


 Add the items to the cart
 Edit the cart contents
 Delete the items from the cart
 Order the items
Check the items present in the store:
When a customer want to place the order, first they have to know what are
all the products that are available in the store and from that list, the customer can select
the required items.

16
CSE, MITS, 2008
J-SHOP

Add the items to the cart:


Once the customer selects all the products from the list, they can add the
selected products to the cart and they can check the cart. From the cart they can edit the
products info or they can delete it as described below.

Edit the cart contents:


For each product in the cart we are having an option for editing the
product information i.e., product quantity. According to the changed quantity, the total
cost of the product and the total amount will be calculated again.

Delete the items from the cart:


Like editing option, the customer is also having the deleting option. With
this option, the products will be removed from the cart list and the total amount will be
recalculated.

Order the items:


After completing the cart design, the customer can order the products
which produce an order number.
After completion of the order the payment will be performed. For that the
system asks the credit card number and password of the customer. If both credit card
number and password are valid at that time only payment module will be performed
otherwise it asks the customer to enter correct credit card number and password.
In addition to that the customer should have sufficient balance in the credit
card otherwise the order will be cancelled. If both credit card number and password are
valid and the customer has sufficient balance in the credit card, then billing will be
performed with the help of banking transactions .Then the items will be delivered to the
particular customer address, within the specified time.

17
CSE, MITS, 2008
J-SHOP

4.2. Overview of JAVA language

Java, whether you love it, or hate it, it's here to stay. Like everyone's favorite
language C, Java has had a major impact on the computing scene. When the history of
computers is written, its name will be up there with the stars.
If you were to choose just one language to learn today, it should be Java.
It's being pushed aggressively by Sun and is growing by leaps and bounds. There are lots
of Java programmers out there and more join the party every day.
Java started out as a bit of an accident. A team under Bill Joy was working
at Sun on a new programming language for embedded applications. Java was originally
expected to work in toasters and fridges, not on modern computers! The initial prognosis
for Java was not good and it was only the rise of the Internet which saved Java from
oblivion. Since then, neither the Net nor Sun nor Java has looked back and all have
grown from strength to strength.
World wide web is an open ended information retrieval system designed to
be used in the distributed environment. This system contains web pages that provide both
information and controls. We can navigate to a new web page in any direction. This is
made possible worth HTML java was meant to be used in distributed environment such
as internet. So java could be easily incorporated into the web system and is capable of
supporting animation graphics , games and other special effect. The web has become
more dynamic and interactive with support of java. We can run a java program on remote
machine over internet with the support of web .

JAVA ENVIRONMENT:
Java environment includes a large no. of tools which are part of the
system known as java development kit (JDK) and hundreds of classes, methods, and
interfaces grouped into packages forms part of java standard library(JSL).

18
CSE, MITS, 2008
J-SHOP

JAVA ARCHITECTURE:
Java architecture provides a portable , robust , high performing
environment for development. Java provides portability by compiling the byte codes for
the java virtual machine which are then interpreted on each platform by the runtime
environment . java also provides stringent compile and runtime checking and automatic
memory management in order to ensure solid code .

JAVA VIRTUAL MACHINE:


When we compile the code, java compiler creates machine code (byte code)
for a hypothetical machine called java virtual machine (jvm). The jvm will execute the
byte code and overcomes the issue of portability . the code is written and compile for one
machine and interpreted all other machines . this machine is called java virtual machine .

PARADIGM OF JAVA:
 Dynamic down loading applets(small application programs);
 Elimination of flatware phenomenon that is providing those features of a
product that user needs at a time. The remaining features of a product can remain in the
server.
 Changing economic model of the software
 Up-to-date software availability
 Supports network entire computing
 Supports CORBA & DCOM

ABOUT HTML:
HTML (hyper text markup language) is a language used to create hyper text
documents that have hyper links embedded in them . it consists of tags embedded in the
text of a document with HTML. We can build web pages or web document s. it is
basically a formatting language and not a programming language. The browser reading
the document interprets mark up tags to help format the document for subsequent display
to a reader. HTML is a language for describing structured documents. HTML is a

19
CSE, MITS, 2008
J-SHOP

platform independent. WWW(world wide web) pages are written using HTML. HTML
tags control in part the representation of the WWW page when view with web browser.
The browser interpretes HTML tags in the web document and displays it. Different
browsers show data differently. Examples of browsers used to be web pages include:
 Netscape
 Internet Explorer

JAVA SCRIPT:
Java script is a general purpose , prototype based , object oriented scripting
language developed jointly by sun and netscape and is meant for the WWW . it is
designed to be embedded in diverse applications and systems , with out consuming much
memory . java script borrows most of its syntax from java but also inherits from awk and
perl , with some indirect influence from self in its object prototype system.
Java scripts dynamically typed that is programs donot declare variable types, and
the type of variable is unrestricted and can change at runtime . source can be generated at
run time and evaluated against an arbitrary scope. Typical implementations compile by
translating source into a specified byte code format, to check syntax and source
consistency. Note that the availability to generate and interprate programs at runtime
implies the presence of a compiler at runtime.
Java script is a high level scripting language that does not depend on or expose
particular machine representations or operating system services. It provides automatic
storage management, typically using a garbage collector.

FEATURES:
 Java script is embedded into HTML documents and is executed with in
them.
 Java script is browser dependent
 Javascript is an interpreted languaged that can be interpreted by the
browser at run time .
 Java script is loosely typed language
 Java script is an object based language.

20
CSE, MITS, 2008
J-SHOP

 Java script is an Eent-Driven language and supports event handlers to


specify the functionality of a button.

ADVANTAGES:
1. java script can be used for client side application
2. java script provides means to contain multiframe windows for
presentation of the web.
3. java script provides basic data validation before it is sent to the
server. Eg : login and password checking or whether the values entered are correct or
whether all fields in a from are filled and reduced network traffic
4. it creates interactive forms and client side lookup tables .

Advanced data types


Increased support for storing persistent Java programming language objects (Java
ob-jects) and a mapping for SQL99 data types such as binary large objects, and structured
types, has been added to the JDBC API. An application may also customize the map-ping
of SQL99 structured types into Java programming language classes.

Rowsets
As its name implies, a rowset encapsulates a set of rows. A rowset may or may
not maintain an open database connection. When a rowset is ‘disconnected’ from its data
source, updates performed on the rowset are propagated to the underlying database us-ing
an optimistic concurrency control algorithm.Rowsets add support to the JDBC API for
the JavaBeans component model. A rowset object is a bean. A rowset implementation
may be serializable. Rowsets can be created at design time and used in conjunction with
other JavaBeans components in a visual builder tool to construct an application.
Other new features
Support for character streams has been added. This means that character data can
be re-trieved and sent to the database as a stream of internationalized Unicode characters.

21
CSE, MITS, 2008
J-SHOP

Methods to allow java.math.BigDecimal values to be returned with full precision have


also been added. Support for time zones has been added.
Introduction to Servlets
Servlets provide a Java(TM)-based solution used to address the problems currently
associated with doing server-side programming, including inextensible scripting
solutions, platform-specific APIs, and incomplete interfaces.
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 client-side --
object bytecodes that can be dynamically loaded off the net. They differ from applets in
that they are faceless objects (without graphics or a GUI component). They serve as
platform-independent, dynamically-loadable, pluggable helper bytecode objects on the
server side that can be used to dynamically extend server-side functionality.
What is a Servlet?
Servlets are modules that extend request/response-oriented servers, such as Java-
enabled web servers. For example, a servlet might be responsible for taking data in an
HTML order-entry form and applying the business logic used to update a company's
order database.
 

Servlets are to servers what applets are to browsers. Unlike applets, however, servlets
have no graphical user interface.
Servlets can be embedded in many different servers because the servlet API, which you
use to write servlets, assumes nothing about the server's environment or protocol.
Servlets have become most widely used within HTTP servers; many web servers support
the Servlet API.

22
CSE, MITS, 2008
J-SHOP

Use Servlets instead of CGI Scripts!


Servlets are an effective replacement for CGI scripts. They provide a way to generate
dynamic documents that is both easier to write and faster to run. Servlets also address the
problem of doing server-side programming with platform-specific APIs: they are
developed with the Java Servlet API, a standard Java extension.
So use servlets to handle HTTP client requests. For example, have servlets process data
POSTed over HTTPS using an HTML form, including purchase order or credit card data.
A servlet like this could be part of an order-entry and processing system, working with
product and inventory databases, and perhaps an on-line payment system.
Other Uses for Servlets
Here are a few more of the many applications for servlets:
 Allowing collaboration between people. A servlet can handle multiple requests
concurrently, and can synchronize requests. This allows servlets to support systems such
as on-line conferencing.

 Forwarding requests. Servlets can forward requests to other servers and servlets.
Thus servlets can be used to balance load among several servers that mirror the same
content, and to partition a single logical service over several servers, according to task
type or organizational boundaries.
Architecture of the Servlet Package
The javax.servlet package provides interfaces and classes for writing servlets. The
architecture of the package is described below.
The Servlet Interface
The central abstraction in the Servlet API is the Servlet interface. All servlets
implement this interface, either directly or, more commonly, by extending a class that
implements it such as HttpServlet.
 

23
CSE, MITS, 2008
J-SHOP

The Servlet interface declares, but does not implement, methods that manage the servlet
and its communications with clients. Servlet writers provide some or all of these methods
when developing a servlet.
 
Client Interaction
When a servlet accepts a call from a client, it receives two objects:
 A ServletRequest, which encapsulates the communication from the client to the
server.
 
 A ServletResponse, which encapsulates the communication from the servlet
back to the client.
ServletRequest and ServletResponse are interfaces defined by the javax.servlet
package.
 
The ServletRequest Interface
The ServletRequest interface allows the servlet access to:
 Information such as the names of the parameters passed in by the client, the
protocol (scheme) being used by the client, and the names of the remote host that made
the request and the server that received it.
 
 The input stream, ServletInputStream. Servlets use the input stream to get data
from clients that use application protocols such as the HTTP POST and PUT methods.

24
CSE, MITS, 2008
J-SHOP

Interfaces that extend ServletRequest interface allow the servlet to retrieve more
protocol-specific data. For example, the HttpServletRequest interface contains
methods for accessing HTTP-specific header information.
 
The ServletResponse Interface
The ServletResponse interface gives the servlet methods for replying to the client. It:
 Allows the servlet to set the content length and MIME type of the reply.

 Provides an output stream, ServletOutputStream, and a Writer through which


the servlet can send the reply data.
Interfaces that extend the ServletResponse interface give the servlet more protocol-
specific capabilities. For example, the HttpServletResponse interface contains methods
that allow the servlet to manipulate HTTP-specific header information.
 
Additional Capabilities of HTTP Servlets
The classes and interfaces described above make up a basic Servlet. HTTP
servlets have some additional objects that provide session-tracking capabilities. The
servlet writer can use these APIs to maintain state between the servlet and the client that
persists across multiple connections during some time period. HTTP servlets also have
objects that provide cookies. The servlet writer uses the cookie API to save data with the
client and to retrieve this data.
  A Simple Servlet
The following class completely defines servlet:
public class SimpleServlet extends HttpServlet
{
/**
* Handle the HTTP GET method by building a simple web page.
*/
public void doGet (HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException
{

25
CSE, MITS, 2008
J-SHOP

PrintWriter out;
String title = "Simple Servlet Output";
// set content type and other response header fields first
response.setContentType("text/html");
// then write the data of the response
out = response.getWriter();
out.println("<HTML><HEAD><TITLE>");
out.println(title);
out.println("</TITLE></HEAD><BODY>");
out.println("<H1>" + title + "</H1>");
out.println("<P>This is output from SimpleServlet.");
out.println("</BODY></HTML>");
out.close();
}}

Servlet Lifecycle
Each servlet has the same life cycle:
1. A server loads and initializes the servlet.
2. The servlet handles zero or more client requests.
3. The server removes the servlet

26
CSE, MITS, 2008
J-SHOP

 
Initializing a Servlet
When a server loads a servlet, the server runs the servlet's init method. Initialization
completes before client requests are handled and before the servlet is destroyed.
Even though most servlets are run in multi-threaded servers, servlets have no
concurrency issues during servlet initialization. The server calls the init method once,
when the server loads the servlet, and will not call the init method again unless the server
is reloading the servlet. The server can not reload a servlet until after the server has
destroyed the servlet by calling the destroy method.

The init Method


The init method provided by the HttpServlet class initializes the servlet and logs the
initialization. To do initialization specific to your servlet, override the init() method
following these rules:
 
 If an initialization error occurs that renders the servlet incapable of handling client
requests, throw an UnavailableException.
An example of this type of error is the inability to establish a required network
connection.
 
 Do not call the System.exit method
 
Initialization Parameters
The second version of the init method calls the getInitParameter method. This
method takes the parameter name as an argument and returns a String representation of
the parameter's value.
The specification of initialization parameters is server-specific. In the Java Web Server,
the parameters are specified with a servlet is added then configured in the Administration
Tool. For an explanation of the Administration screen where this setup is performed, see
the Administration Tool: Adding Servlets online help document.

27
CSE, MITS, 2008
J-SHOP

If, for some reason, you need to get the parameter names, use the getParameterNames
method.
Destroying a Servlet
Servlets run until the server are destroys them, for example at the request of a system
administrator. When a server destroys a servlet, the server runs the servlet's destroy
method. The method is run once; the server will not run that servlet again until after the
server reloads and reinitializes the servlet.
When the destroy method runs, another thread might be running a service request. The
Handling Service Threads at Servlet Termination section shows you how to provide a
clean shutdown when there could be long-running threads still running service requests.

Using the Destroy Method


The destroy method provided by the HttpServlet class destroys the servlet and logs
the destruction. To destroy any resources specific to your servlet, override the destroy
method. The destroy method should undo any initialization work and synchronize
persistent state with the current in-memory state.
The following example shows the destroy method that accompanies the init method
shown previously:
public class BookDBServlet extends GenericServlet {
private BookstoreDB books;
... // the init method
public void destroy()
{
// Allow the database to be garbage collected
books = null;
}
}
A server calls the destroy method after all service calls have been completed, or a
server-specific number of seconds have passed, whichever comes first. If your servlet
handles any long-running operations, service methods might still be running when the

28
CSE, MITS, 2008
J-SHOP

server calls the destroy method. You are responsible for making sure those threads
complete. The next section shows you how.
The destroy method shown above expects all client interactions to be completed when
the destroy method is called, because the servlet has no long-running operations.

Compile the servlet

Make sure the compiler will be able to find the jws.jar file. The jws.jar file
contains Java Web Server's implementation of the Servlet API. Ensuring the compiler can
find the file is easy to do using the cp option to the compiler, as we do below. (You can
also modify the classpath environment variable temporarily from a command line or
permanently in your system setttings.)
Use javac, located in the Java Web Server's jre/bin directory, to compile
the .java file. You'll need to copy the resulting .class file to the servlets directory of the
Java Web Server so the web server will automatically find it. To skip the copying step,
simply invoke javac with the -d option to direct the resulting .class file to the target
directory.
For example, the following command compiles MyFirst.java and stores the resulting
MyFirst.class file in the servlets directory:
javac -cp server_root/lib/jws.jar -d server_root/servlets MyFirst.java
where server_root is the directory of the installed Java Web Server.
Install the servlet
The process for installing a servlet into a web server varies from web server to webserver.
For the Java Web Server, the procedure is as follows:

1. Start the Java Web Server, if it is not already running


2. Log in to the Java Web Server on the administration port.
By default, the administration port is 9090 and the username/password is admin/admin. If
you are successful, you should see the services page of the AdminTool applet.
3. Select the WebPage Service then click the Manage button. This should bring up
the Web Service window.

29
CSE, MITS, 2008
J-SHOP

4. Click the Servlets button, then select the Add entry in the list in the lefthand pane.
You should now see the Add a New Servlet fields in the righthand pane.
5. Fill in the fields as follows:
1. Servlet Name: Choose any name you like, it need not be related to the filename.
This will be the name used to invoke the servlet. We'll use FirstServlet.
2. Servlet Class: Provide the actual name of the servlet class, not file, you created --
for this example the real name is MyFirst.
3. Click the Add button and you will see your servlet name appear in the list of
servlets in the lefthand pane under Configure. The righthand pane will have
changed to two tabbed panels -- Configuration and Properties. We won't need
these for our simple example so simply close the window.

AN OVERVIEW OF JSP:

Java Server Pages technology is the powerful java technology in the J2EE platform
for building and maintaining the applications containing dynamic web contents such as
HTML, DHTML, XHTML, XHTML, and XML. The Java Server Pages that create
dynamic content easily but with maximum power and flexibility.
The Java server Pages technology provides a textual description for the creation of a
response from a request. It architecture enables the separation of content generation from
the content presentation. Java Server Pages offers proven portability, open standards, and a
mature re-usable component model.

Process of Java Server Pages:


A JSP page is just like any other HTML file. It contains HTML formatting tags and
can include client-side Java Script, Flash Animations, and Java Applets. A JSP page also
includes java code and must have .jsp extension.
Java statements must be placed within <%and%> tag delimiters. Process of JSP
page is shown in below figure in stepwise.

Access Models:

30
CSE, MITS, 2008
J-SHOP

A Java Server Pages file may be accessed in at least two different ways:
1. A client request comes directly into a Java Server Page.
In this scenario, suppose the page accesses reusable Java Bean components that
perform particular well-defined computations like accessing a database. The results of the
Bean’s computations, called result sets are stored within the Bean as properties. The page
uses such Beans to generate dynamic content and present back to the client.

2. A request comes through a servlet.


The servlet generates the dynamic content. To handle the response to the client,
the servlet creates a bean and stores the dynamic in the bean. The servlet then invokes a
Java Server Page that will present the content along with the Bean containing the
generated Servlet.

What a JSP Page is?

A JSP page is a text-based document that contains two types of text: static
template data, which can be expressed in any text-based format, such as HTML,
SVG, WML, and XML; and JSP elements, which construct dynamic content.

The Life Cycle of a JSP Page :

A JSP page services requests as a servlet. Thus, the life cycle and many of the
capabilities of JSP pages (in particular the dynamic aspects) are determined by
Java Servlet technology.

When a request is mapped to a JSP page, it is handled by a special servlet that


first checks whether the JSP page's servlet is older than the JSP page. If it is, it
translates the JSP page into a servlet class and compiles the class. During
development, one of the advantages of JSP pages over servlets is that the build
process is performed automatically.

31
CSE, MITS, 2008
J-SHOP

Translation and Compilation :

During the translation phase, each type of data in a JSP page is treated differently.
Template data is transformed into code that will emit the data into the stream that
returns data to the client. JSP elements are treated as follows:

 Directives are used to control how the Web container translates and
executes the JSP page.
 Scripting elements are inserted into the JSP page's servlet class. See JSP
Scripting Elements for details.
 Elements of the form <jsp:XXX ... /> are converted into method
calls to JavaBeans components or invocations of the Java Servlet API.

For a JSP page named pageName, the source for a JSP page's servlet is kept in
the file

J2EE_HOME/repository/host/web/
context_root/_0002fpageName_jsp.java

For example, the source for the index page (named index.jsp) for the date
localization example discussed at the beginning of the chapter would be named

J2EE_HOME/repository/host/web/date/_0002findex_jsp
.java

Both the translation and compilation phases can yield errors that are only
observed when the page is requested for the first time. If an error occurs while the
page is being translated (for example, if the translator encounters a malformed
JSP element), the server will return a ParseException, and the servlet class
source file will be empty or incomplete. The last incomplete line will give a
pointer to the incorrect JSP element.

32
CSE, MITS, 2008
J-SHOP

If an error occurs while the JSP page is being compiled (for example, there is a
syntax error in a scriptlet), the server will return a JasperException and a
message that includes the name of the JSP page's servlet and the line where the
error occurred.

Once the page has been translated and compiled, the JSP page's servlet for the
most part follows the servlet life cycle described in the section Servlet Life Cycle:

1. If an instance of the JSP page's servlet does not exist, the container:
a. Loads the JSP page's servlet class
b. Instantiates an instance of the servlet class
c. Initializes the servlet instance by calling the jspInit method

2. Invokes the _jspService method, passing a request and response


object.

If the container needs to remove the JSP page's servlet, it calls the jspDestroy
method.

Execution :

You can control various JSP page execution parameters using by page
directives. The directives that pertain to buffering output and handling errors are
discussed here. Other directives are covered in the context of specific page
authoring tasks throughout the chapter.

Buffering :

When a JSP page is executed, output written to the response object is


automatically buffered. You can set the size of the buffer with the following
page directive:

<%@ page buffer="none|xxxkb" %>

33
CSE, MITS, 2008
J-SHOP

A larger buffer allows more content to be written before anything is actually sent
back to the client, thus providing the JSP page with more time to set appropriate
status codes and headers or to forward to another Web resource. A smaller buffer
decreases server memory load and allows the client to start receiving data more
quickly.

Handling Errors :

Any number of exceptions can arise when a JSP page is executed. To specify that
the Web container should forward control to an error page if an exception occurs,
include the following page directive at the beginning of your JSP page:

<%@ page errorPage="file_name" %>

The Duke's Bookstore application page initdestroy.jsp contains the


directive

<%@ page errorPage="errorpage.jsp"%>

The beginning of errorpage.jsp indicates that it is serving as an error page


with the following page directive:

<%@ page isErrorPage="true|false" %>

This directive makes the exception object (of type


javax.servlet.jsp.JspException) available to the error page, so that
you can retrieve, interpret, and possibly display information about the cause of the
exception in the error page.

Note: You can also define error pages for the WAR that contains a JSP page. If
error pages are defined for both the WAR and a JSP page, the JSP page's error
page takes precedence.

34
CSE, MITS, 2008
J-SHOP

Custom Tags in JSP Pages :

Stephanie Bodoff :

The standard JSP tags for invoking operations on JavaBeans components and
performing request dispatching simplify JSP page development and maintenance.
JSP technology also provides a mechanism for encapsulating other types of
dynamic functionality in custom tags, which are extensions to the JSP language.
Custom tags are usually distributed in the form of a tag library, which defines a
set of related custom tags and contains the objects that implement the tags.

Some examples of tasks that can be performed by custom tags include operations
on implicit objects, processing forms, accessing databases and other enterprise
services such as e-mail and directories, and performing flow control. JSP tag
libraries are created by developers who are proficient at the Java programming
language and expert in accessing data and other services, and are used by Web
application designers who can focus on presentation issues rather than being
concerned with how to access enterprise services. As well as encouraging division
of labor between library developers and library users, custom tags increase
productivity by encapsulating recurring tasks so that they can be reused across
more than one application.

Tag libraries are receiving a great deal of attention in the JSP technology
community

What Is a Custom Tag?

A custom tag is a user-defined JSP language element. When a JSP page


containing a custom tag is translated into a servlet, the tag is converted to
operations on an object called a tag handler. The Web container then invokes
those operations when the JSP page's servlet is executed.

Custom tags have a rich set of features. They can

35
CSE, MITS, 2008
J-SHOP

 Be customized via attributes passed from the calling page.


 Access all the objects available to JSP pages.
 Modify the response generated by the calling page.
 Communicate with each other. You can create and initialize a JavaBeans
component, create a variable that refers to that bean in one tag, and then use the
bean in another tag.
 Be nested within one another, allowing for complex interactions within a
JSP page.

Using Tags :

This section describes how a page author specifies that a JSP page is using a tag
library and introduces the different types of tags.

Declaring Tag Libraries :

You declare that a JSP page will use tags defined in a tag library by including a
taglib directive in the page before any custom tag is used:

<%@ taglib uri="/WEB-INF/tutorial-template.tld"


prefix="tt" %>

The uri attribute refers to a URI that uniquely identifies the tag library descriptor
(TLD), described in the section Tag Library Descriptors. This URI can be direct
or indirect. The prefix attribute defines the prefix that distinguishes tags
defined by a given tag library from those provided by other tag libraries.

Tag library descriptor file names must have the extension .tld. TLD files are
stored in the WEB-INF directory of the WAR or in a subdirectory of WEB-INF.
You can reference a TLD directly and indirectly.

The following taglib directive directly references a TLD filename:

36
CSE, MITS, 2008
J-SHOP

<%@ taglib uri="/WEB-INF/tutorial-template.tld"


prefix="tt" %>

This taglib directive uses a short logical name to indirectly reference the TLD:

<%@ taglib uri="/tutorial-template" prefix="tt" %>

A logical name must be mapped to an absolute location in the Web application


deployment descriptor. To map the logical name /tutorial-template to the
absolute location /WEB-INF/tutorial-template.tld:

1. Select Bookstore3WAR.

2. Select the File Refs tab.

3. Click the Add button in the JSP Tag Libraries subpane.

4. Enter the relative URI /tutorial-template in the Coded Reference


field.

5. Enter the absolute location /WEB-INF/tutorial-template.tld in


the Tag Library field.

Types of Tags :

JSP custom tags are written using XML syntax. They have a start tag and end tag,
and possibly a body:

<tt:tag>
body
</tt:tag>

37
CSE, MITS, 2008
J-SHOP

A custom tag with no body is expressed as follows:

<tt:tag />

Simple Tags :

A simple tag contains no body and no attributes:

<tt:simple />

Tags With Attributes :

A custom tag can have attributes. Attributes are listed in the start tag and have the
syntax attr="value". Attribute values serve to customize the behavior of a
custom tag just as parameters are used to customize the behavior of a method.

You specify the types of a tag's attributes in a tag library descriptor (see Tag
Library Descriptors).

You can set an attribute value from a String constant or a runtime expression.
The conversion process between the constants and runtime expressions and
attribute types follows the rules described for JavaBeans component properties in
Setting JavaBeans Component Properties.

The attributes of the Struts logic:present tag determine whether the body of
the tag is evaluated. In the following example, an attribute specifies a request
parameter named Clear:

<logic:present parameter="Clear">

38
CSE, MITS, 2008
J-SHOP

The Duke's Bookstore application page catalog.jsp uses a runtime


expression to set the value of the attribute that determines the collection of books
over which the Struts logic:iterate tag iterates:

<logic:iterate collection="<%=bookDB.getBooks()%>"
id="book" type="database.BookDetails">

Tags with Bodies :

A custom tag can contain custom and core tags, scripting elements, HTML text,
and tag-dependent body content between the start and end tag.

In the following example, the Duke's Bookstore application page


showcart.jsp uses the Struts logic:present tag to clear the shopping
cart and print a message if the request contains a parameter named Clear:

<logic:present parameter="Clear">
<% cart.clear(); %>
<font color="#ff0000" size="+2"><strong>
You just cleared your shopping cart!
</strong><br>&nbsp;<br></font>
</logic:present>

Choosing between Passing Information as Attributes or Body :

As shown in the last two sections, it is possible to pass a given piece of data as an
attribute of the tag or as the tag's body. Generally speaking, any data that is a
simple string or can be generated by evaluating a simple expression is best passed
as an attribute.

39
CSE, MITS, 2008
J-SHOP

Tags That Define Scripting Variables :

A custom tag can define a variable that can be used in scripts within a page. The
following example illustrates how to define and use a scripting variable that
contains an object returned from a JNDI lookup. Examples of such objects
include enterprise beans, transactions, databases, environment entries, and so on:

<tt:lookup id="tx" type="UserTransaction"


name="java:comp/UserTransaction" />
<% tx.begin(); %>

In the Duke's Bookstore application, several pages use bean-oriented tags from
Struts to define scripting variables. For example, bookdetails.jsp uses the
bean:parameter tag to create the bookId scripting variable and set it to the
value of the bookId request parameter. The jsp:setProperty statement
also sets the bookId property of the bookDB object to the value of the bookId
request parameter. The bean:define tag retrieves the value of the bookstore
database property bookDetails and defines the result as the scripting variable
book:

<bean:parameter id="bookId" name="bookId" />


<jsp:setProperty name="bookDB" property="bookId"/>
<bean:define id="book" name="bookDB"
property="bookDetails"
type="database.BookDetails"/>
<h2><jsp:getProperty name="book"
property="title"></h2>

Cooperating Tags :

40
CSE, MITS, 2008
J-SHOP

Customer tags can cooperate with each other through shared objects. In
the following example, tag1 creates an object called obj1, which is then reused
by tag2.

<tt:tag1 attr1="obj1" value1="value" />


<tt:tag2 attr1="obj1" />

In the next example, an object created by the


enclosing tag of a group of nested tags is available to all
inner tags. Since the object is not named, the potential for
naming conflicts is reduced. This example illustrates how a
set of cooperating nested tags would appear in a JSP page.

<tt:outerTag>
<tt:innerTag />
</tt:outerTag>
Defining Tags :

To define a tag, you need to:

 Develop a tag handler and helper classes for the tag


 Declare the tag in a tag library descriptor

This section describes the properties of tag handlers and TLDs and explains how
to develop tag handlers and library descriptor elements for each type of tag
introduced in the previous section.

Tag Handlers :

A tag handler is an object invoked by a Web container to evaluate a custom tag


during the execution of the JSP page that references the tag. Tag handlers must
implement either the Tag or BodyTag interface. Interfaces can be used to take
an existing Java object and make it a tag handler. For newly created handlers, you

41
CSE, MITS, 2008
J-SHOP

can use the TagSupport and BodyTagSupport classes as base classes.


These classes and interfaces are contained in the
javax.servlet.jsp.tagext package.

Tag handler methods defined by the Tag and BodyTag interfaces are called by
the JSP page's servlet at various points during the evaluation of the tag. When the
start tag of a custom tag is encountered, the JSP page's servlet calls methods to
initialize the appropriate handler and then invokes the handler's doStartTag
method. When the end tag of a custom tag is encountered, the handler's
doEndTag method is invoked. Additional methods are invoked in between when
a tag handler needs to interact with the body of the tag. For further information,
see How Is a Tag Handler Invoked?. In order to provide a tag handler
implementation, you must implement the methods, summarized in Table 13-1,
that are invoked at various stages of processing the tag.

A tag handler has access to an API that allows it to communicate with the JSP
page. The entry point to the API is the page context object
(javax.servlet.jsp.PageContext), through which a tag handler can
retrieve all the other implicit objects (request, session, and application) accessible
from a JSP page.

Implicit objects can have named attributes associated with them. Such attributes
are accessed using [set|get]Attribute methods.

If the tag is nested, a tag handler also has access to the handler (called the parent)
associated with the enclosing tag.

42
CSE, MITS, 2008
J-SHOP

Tags with Attributes

Defining Attributes in a Tag Handler

For each tag attribute, you must define a property and get and set methods that
conform to the JavaBeans architecture conventions in the tag handler. For
example, the tag handler for the Struts logic:present tag,

<logic:present parameter="Clear">

contains the following declaration and methods:

protected String parameter = null;


public String getParameter() {
return (this.parameter);
}
public void setParameter(String parameter) {
this.parameter = parameter;
}

Note that if your attribute is named id and your tag handler inherits from the
TagSupport class, you do not need to define the property and set and get methods
because these are already defined by TagSupport.

A tag attribute whose value is a String can name an attribute of one of the implicit
objects available to tag handlers. An implicit object attribute would be accessed
by passing the tag attribute value to the [set|get]Attribute method of the implicit
object. This is a good way to pass scripting variable names to a tag handler where
they are associated with objects stored in the page context (see Tags That Define
Scripting Variables).

43
CSE, MITS, 2008
J-SHOP

Attribute Element

For each tag attribute, you must specify whether the attribute is required, whether
the value can be determined by an expression, and, optionally, the type of the
attribute in an attribute element. For static values the type is always
java.lang.String. If the rtexprvalue element is true or yes, then the type element
defines the return type expected from any expression specified as the value of the
attribute.

<attribute>
<name>attr1</name>
<required>true|false|yes|no</required>
<rtexprvalue>true|false|yes|no</rtexprvalue>
<type>fully_qualified_type</type>
</attribute>

If a tag attribute is not required, a tag handler should provide a default value.

The tag element for the logic:present tag declares that the parameter attribute is
not required (because the tag can also test for the presence of other entities such
as bean properties) and that its value can be set by a runtime expression.

<tag>
<name>present</name>
<tag-class>org.apache.struts.taglib.
logic.PresentTag</tag-class>
<body-content>JSP</body-content>
...
<attribute>
<name>parameter</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>

44
CSE, MITS, 2008
J-SHOP

</attribute>
...
</tag>

Attribute Validation

The documentation for a tag library should describe valid values for tag attributes.
When a JSP page is translated, a Web container will enforce any constraints
contained in the TLD element for each attribute.

The attributes passed to a tag can also be validated at translation time with the
isValid method of a class derived from TagExtraInfo. This class is also used to
provide information about scripting variables defined by the tag (see Tags That
Define Scripting Variables).

The isValid method is passed the attribute information in a TagData object, which
contains attribute-value tuples for each of the tag's attributes. Since the validation
occurs at translation time, the value of an attribute that is computed at request
time will be set to TagData.REQUEST_TIME_VALUE.

The tag <tt:twa attr1="value1"/> has the following TLD attribute element:

<attribute>
<name>attr1</name>
<required>true</required>
<rtexprvalue>true</a>
</attribute>

This declaration indicates that the value of attr1 can be determined at runtime.

The following isValid method checks that the value of attr1 is a valid Boolean
value. Note that since the value of attr1 can be computed at runtime, isValid must
check whether the tag user has chosen to provide a runtime value.

45
CSE, MITS, 2008
J-SHOP

public class TwaTEI extends TagExtraInfo {


public boolean isValid(Tagdata data) {
Object o = data.getAttribute("attr1");
if (o != null && o != TagData.REQUEST_TIME_VALUE) {
if (o.toLowerCase().equals("true") ||
o.toLowerCase().equals("false") )
return true;
else
return false;
}
else
return true;
}
}

Tags With Bodies

Tag Handlers

A tag handler for a tag with a body is implemented differently depending on


whether the tag handler needs to interact with the body or not. By interact, we
mean that the tag handler reads or modifies the contents of the body.

Cooperating Tags

Tags cooperate by sharing objects. JSP technology supports two styles of object
sharing. The first style requires that a shared object be named and stored in the
page context (one of the implicit objects accessible to both JSP pages and tag
handlers). To access objects created and named by another tag, a tag handler uses
the pageContext.getAttribute(name, scope) method.

46
CSE, MITS, 2008
J-SHOP

In the second style of object sharing, an object created by the enclosing tag
handler of a group of nested tags is available to all inner tag handlers. This form
of object sharing has the advantage that it uses a private namespace for the
objects, thus reducing the potential for naming conflicts.

To access an object created by an enclosing tag, a tag handler must first obtain its
enclosing tag with the static method TagSupport.findAncestorWithClass(from,
class) or the TagSupport.getParent method. The former method should be used
when a specific nesting of tag handlers cannot be guaranteed. Once the ancestor
has been retrieved, a tag handler can access any statically or dynamically created
objects. Statically created objects are members of the parent. Private objects can
also be created dynamically. Such objects can be stored in a tag handler with the
setValue method and retrieved with the getValue method.

The following example illustrates a tag handler that supports both the named and
private object approaches to sharing objects. In the example, the handler for a
query tag checks whether an attribute named connection has been set in the
doStartTag method. If the connection attribute has been set, the handler retrieves
the connection object from the page context. Otherwise, the tag handler first
retrieves the tag handler for the enclosing tag and then retrieves the connection
object from that handler.

public class QueryTag extends BodyTagSupport {


private String connectionId;
public int doStartTag() throws JspException {
String cid = getConnection();
if (cid != null) {
// there is a connection id, use it
connection =(Connection)pageContext.
getAttribute(cid);
} else {
ConnectionTag ancestorTag =

47
CSE, MITS, 2008
J-SHOP

(ConnectionTag)findAncestorWithClass(this,
ConnectionTag.class);
if (ancestorTag == null) {
throw new JspTagException("A query without
a connection attribute must be nested
within a connection tag.");
}
connection = ancestorTag.getConnection(); } }}

The query tag implemented by this tag handler could be used in either of the
following ways:

<tt:connection id="con01" ....> ... </tt:connection>


<tt:query id="balances" connection="con01">
SELECT account, balance FROM acct_table
where customer_number = <%= request.getCustno()%>
</tt:query>
<tt:connection ...>
<x:query id="balances">
SELECT account, balance FROM acct_table
where customer_number = <%= request.getCustno()%>
</x:query>
</tt:connection>

The TLD for the tag handler must indicate that the connection attribute is optional
with the following declaration:

<tag>
...
<attribute>
<name>connection</name>
<required>false</required>

48
CSE, MITS, 2008
J-SHOP

</attribute>
</tag>

Advantages of JSP:
While JSP is extremely powerful and capable of creating complex web
applications, it is also very easy to learn. JSP offers the following advantages over other
server-side technologies.

1. JSP leverages the power of Java.


2. JSP simplifies web development.
3. JSP is not limited to a particular platform or vender.
4. JSP is an integral part of java 2Enterprise Edition.
5. JSP is extensible.

5. TESTING
5.1 Testing Fundamentals

TESTING METHOD:

Software Testing is a critical element of software quality assurance and


represents the ultimate review of specification, design and coding. Testing is the one step
in software engineering process that could be viewed as destructive rather than
constructive. The goal of testing is to verify the design and logical operation of the design
blocks to determine that they operate as intended.

TESTING OBJECTIVES:

 Testing is a process of executing a program with the intend of finding an error.

49
CSE, MITS, 2008
J-SHOP

 A good test case is one that has a high probability of finding a yet undiscovered
error.
 A successful test is one that uncovers yet undiscovered error.
 Testing cannot show the absence of defects, it can show that software errors are
present.

TESTING PRINCIPLES:

 All tests should be traceable to customer requirements.


 Tests should be planned long before testing begins.
 The pare to principle applies to software testing.
 Testing should begin “in the small” and progress toward testing “in the long”.
 Exhaustive testing is not possible.

5.2 White Box Testing:

A complementary technique, white box testing or structural testing, uses


information about the structure of the program to check that it performs correctly. Clear
box testing, glass box testing or structural testing is used in computer programming,
software engineering and software testing to check that the outputs of a program, given
certain inputs, conform to the structural specifications of the program.

The term white box (or glass box) indicates that testing is done with
knowledge of the code used to execute certain functionality. For this reason, a
programmer is usually required to perform white box tests. Often, multiple programmers
will write tests based on certain code, so as to gain varying perspectives on possible
outcomes.

50
CSE, MITS, 2008
J-SHOP

5.3 Black Box Testing:

Black Box testing, concrete box or functional testing is used in computer


programming, software engineering and software testing to check that the outputs of a
program, given certain inputs, conform to the functional specification of the program.

The term black box indicates that the tester does not examine the internal
implementation of the program being executed. For this reason, the programmer does not
normally carry out black box testing.

5.4 Sample Test Cases


In order to uncover the errors present in different phases we have the concept
of Testing Levels
The basics levels of testing are:

5.4.1 Unit Testing:


In unit testing each service is tested on its own by its own
developer. In this developer enters the sample relevant data and execute successfully. The
developer views the result in this report.

5.4.2 Integration Testing:


Data can be grossed across an interface; one module can have
adverse efforts on another. Integration testing is systematic testing for construction the
program structure while at the same time conducting tests to uncover errors associated
with in the interface. The objective is to take unit tested as a whole. Here correction is
difficult because the isolation of cause is complicate by the vast expense of the entire
program. Thus in the integration testing stop, all the errors uncovered are corrected for
the next testing steps.

51
CSE, MITS, 2008
J-SHOP

5.4.3 System Testing


In the testing whole application is tested together. The
components are tested to ensure that they work properly together, that they do not cause
system resource bottlenecks. Each stakeholder logins into the system with his own user-
id and password depending upon which services are provided.

5.4.4 User acceptance testing:


User acceptance of a system is the key factor of the success of
any system. The system under study is tested for the user acceptance by constantly
keeping in touch with the prospective systems users at the time of developing and making
changes wherever required.

6. RESULTS

52
CSE, MITS, 2008
J-SHOP

Home page

53
CSE, MITS, 2008
J-SHOP

54
CSE, MITS, 2008
J-SHOP

55
CSE, MITS, 2008
J-SHOP

Customer registration page

56
CSE, MITS, 2008
J-SHOP

Customer Login page

57
CSE, MITS, 2008
J-SHOP

Selecting Customer options

58
CSE, MITS, 2008
J-SHOP

Merchant Login page

59
CSE, MITS, 2008
J-SHOP

Selecting Merchant Options

60
CSE, MITS, 2008
J-SHOP

Adding a new category

61
CSE, MITS, 2008
J-SHOP

Adding a new product under a category

62
CSE, MITS, 2008
J-SHOP

Viewing product list

63
CSE, MITS, 2008
J-SHOP

Selecting multiple products at a time

64
CSE, MITS, 2008
J-SHOP

Adding selected products to the cart

65
CSE, MITS, 2008
J-SHOP

Viewing cart contents

66
CSE, MITS, 2008
J-SHOP

Payment form

67
CSE, MITS, 2008
J-SHOP

Processing the order to the particular customer address

68
CSE, MITS, 2008
J-SHOP

Updating existing category details

69
CSE, MITS, 2008
J-SHOP

Updating existing product details

70
CSE, MITS, 2008
J-SHOP

71
CSE, MITS, 2008
J-SHOP

Deleting an existing product

72
CSE, MITS, 2008
J-SHOP

73
CSE, MITS, 2008
J-SHOP

Processing the Orders

74
CSE, MITS, 2008
J-SHOP

75
CSE, MITS, 2008
J-SHOP

7. CONCLUSION AND FUTURE WORK

This system is implemented fulfilling all the client requirements. The interfaces
designed for the system is very user friendly and attractive. It has successfully
implemented the shopping transactions like adding the categories and products and
maintaining them, placing orders, managing carts etc., successfully as per the client
requirement. The system has successfully passed the testing at the development site and
is under the testing phase in the presence of the client. The system is waiting for the client
response.

This project is having a broad future scope as it can be extended to provide


services to the customers on line. This system can be implemented for online transactions
without the intervention of the authority. If it is done, the customer can access the store
from anywhere in the world. He can order the products without going to the store
physically. In other words the future scope is to provide the service through the Internet.

76
CSE, MITS, 2008
J-SHOP

8. REFERENCES

1. Systems Analysis and Design - Elias M. Award.


2. Software Engineering - Roger S. Pressman
3. Java Complete Reference - Herbert Shield
4. Java Servlet Programming - Orielly Publications
5. Oracle 8 The Complete Reference - George Coach, Kevin Loney

77
CSE, MITS, 2008

You might also like