Вы находитесь на странице: 1из 7

Online Shopping

3.3.1. SELECTION OF LANGUAGE:

Ideally software requirements should precipitate the


selection of a language that is best fit to the processing functions to be
carried out. By considering the requirements and different language
features required in the design phase, the best-suited software could
be selected

The process, which is specified in the design phase,


needs data structures, memory speed and efficiency, graphic support,
control structures and file manipulation operations. The concept of
modularity and module independence is mainly required for object
oriented programming specifications like windows programming.

3.3.2. KEY FEATURES OF SERVLETS:

Unlike CGI and FastCGI, which use multiple processes to handle

separate requests, servlets are handled by separate threads within the

web server.

• Servlets are efficient and scalable.

• Servlets are portable across operating systems and across

• server implementations.

• Servlet invocation is highly efficient. Once a servlet is loaded,it

generally remains in the server’s memory as a single object instance.

• Servlet code is clean, object oriented, modular, and amazingly simple.

48

Dept of C.S.E. Narayana Engineering College., Nellore.


Online Shopping

• Servlets can handle errors safely, due to Java’s exception-handling

mechanism.

• Servlets are also quite flexible and easily extensible.

3.3.3. CODING STANDARDS:

Code documentation:

While concerning the procedural design language


specified in the design phase for each module, the code
documentation, the identifier naming is done meaningfully for the ease
of understanding. The related data names with the remarks are
specified in each module of the project.

Data declaration:

The different types of data are declared namely integer,


real, char and long integer data types, which are needed for the huge
data streams processing.

Statement constructs:
The statement constructs used are sequence, conditions
and looping. For each construct the coding is done as a block of
statements for easy understanding, for the complex arithmetic
statements the parentheses are used.

49

Dept of C.S.E. Narayana Engineering College., Nellore.


Online Shopping

3.3.4 PSUEDO CODE OF MODULES:

The screens used in this project are developed


using HTML. Various Text fields, buttons, forms and a display are used
in the development process.

1. Login Screen
In the coding of the screens various Java packages
has been imported.

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.sql.*;
import java.lang.String.*;
import java.util.*;
import util.StringTokenizer.*;

Servlets use classes and interfaces from two packages javax.servlt


and javax.servlet.http.The javax.servlet contain classes to support
generic, protocol-independent servlets.
Every servlet must implement the javax.servlet.Servlet
interface. Most servlets implement it by extending one of two special
classes:javax.servlet.GenericServlet or javax.servlet.HttpServlet.

public class Sample extends Httpservlet

50

Dept of C.S.E. Narayana Engineering College., Nellore.


Online Shopping

public void doGet (HttpServletRequest req, HttpServletREsponse res)


throws servletException, IOException {

Any servlet uses the setContentType () method of the response


object to set the content type of its response to “text/html”, the
standard MIME content type for HTML pages. Then, it uses the get
Writer() method to retrieve a print-Writer, the international-friendly
counterpart to a printStream.

When a client connects to a server and makes an HTTP


request, the request can be of several different types, called methods.
The more frequently used methods are GET and POST. The Get
method is designed for getting information, while the POST method is
designed for posting information.

A servlet can identity the user through her username and


thereby track her session.
String sessionid=req.getpathInfo();
If(sessionid==null)

{
sessionid=user_id; }
For the first time the sessionid is null, so we are generating the
sessionid as user_id.

The sessionid is passed to the next servlet as:

51

Dept of C.S.E. Narayana Engineering College., Nellore.


Online Shopping

out.println("<form
action=http://localhost:8080/servlet/sampleservlet/" + sessionid + ">");

Through the a href the sessionid is passed as:

out.println("<a
href=http://localhost:8080/servlet/signoutServlet/" + sessionid +
">signout</a>");

In the Homepage various text fields like customer_id and


password are used in which the user enters his ID and password.
Userid:<input type="text" name="userid"></td>
Password:<input type="password" name="password"></td>

2.Registration Screen:
Registration form contains various text fields like username,
user id, password, city, state etc.., in which the user enters the details.

<input type="text" name="name"></td>


<input type="text" name="userid"></td>
<input type="password" name="password"></td>

<input type="password" name="Cpassword"></td>

<input type="text" name="address"></td>


<input type="text" name="city"></td>
<input type="text" name="state"></td>
<input type="text" name="pincode"></td>
<input type="text" name="pincode"></td>
<input type="SUBMIT" name="SUBMIT" VALUE="SUBMIT">

3. Items Screen:
52

Dept of C.S.E. Narayana Engineering College., Nellore.


Online Shopping

The administrator can insert the items in his shop. This HTML
contains Text fields like Itemcode, Itemname, Itemdescription, Number
of items etc.

<input type="text" name="itemname"></td>

<input type="text" name="itemcode"></td>

<input type="text" name="noofitems"></td>

<input type="text" name="itemspath"></td>

<input type="text" name="cost"></td>

<input type="text" name="itemdesc"></tr>

<input type="SUBMIT" name="SUBMIT" VALUE="SUBMIT">

4. Items Deletion Screen:

The Administrator can delete the items in his shop by specifying


the Itemcode he wants to delete.

<input type="text" name="itemcode"></td>

5. Receiving Credit card Number:

This screen gathers the Credit card number of the customer


and checks the validity of the credit card.

53

Dept of C.S.E. Narayana Engineering College., Nellore.


Online Shopping

<input type="text" name="crid"></td>

54

Dept of C.S.E. Narayana Engineering College., Nellore.

Вам также может понравиться