Anda di halaman 1dari 46

A

Project Report
On
1. Java Quiz World using Java
2. Simple Login page using Web Server
FOR

Submitted by: ABHINAV MADAN

Roll No: 08-IT-503

Under the guidance of


Mr. Kamal Kumar
Senior Consultant, OPS Web Portal
Wipro Ltd., Gurgaon

Gurgaon Institute of Technology & Management


Gurgaon

UNDERTAKING
This is hereby stated that this report is very original in
every sense of the term and it carries a sense of creditability and
strength and that I have taken no shortcuts and remained both
rigorous and scholarly.

I have tried my best to keep this work as watertight and squeaky


clean as possible.

It may be further stated here that in the preparation of this report


and projects undertaken some aid has been taken from a pool of
professionally shared knowledge, a detailed description of
which has been mentioned in the bibliography section of this
report.

Dated: 30.07.10
Signature
ACKNOWLEDGEMENT

First of all I wish to thank all the respectable executives of


OPS Web Portal team of Wipro Ltd., Gurgaon for giving
me this opportunity of summer training which has been a
pure learning experience and enlightened my knowledge
and skills.

I am specially thankful to my mentor Mr. Kamal Kumar for


guidance and cooperation during this training and in fact
without their navigational assistance it would have been
very difficult structuring the projects. I would be always
grateful to them for their help and support.
SUMMARY
The purpose of this report is to literally act as a window to
the projects undertaken as a part of summer training with
the organization Wipro Ltd.

The objective of the projects that have been assigned as a


part of the training is:
1. To develop a Quiz System using Java Applets.
2. To make a login page using struts on Apache Web
Server.
Each of this requires a basic knowledge about Java GUI
and J2EE and how to use Apache Web Server.

1. Quiz System is a java based project which is made to


have a quiz on the topics of Java. This is made to
enhance the knowledge of the user about the well
know language. It can be taken by anyone who
wishes to take the quiz. After the quiz has been taken
it generates the report of that user whether he is pass
or fail and what the score of that user is. That will help
the user to know about his performance.

2. Login Page using Struts on Apache Web Server: this


project is made using JSP and Struts on Web Server.
This simply consist of login page when a user enter
the username and password then it goes to
successful login page and when the username and
password does not match then it takes to the failure
page. This is just to have the knowledge about the
struts.
Table of Contents

1. Introduction
2. Feasibility Study
3. Java Quiz World
3.1. Introduction
3.2. Functional or Specific Requirements
3.2.1. Technologies Used
3.2.2. Software System Attributes
3.3. Analysis and Design
3.3.1. Use Case Diagram
3.3.2. Data Flow Diagram
3.3.3. Database Design
3.4. User Interfaces
3.4.1. Login page
3.4.2. Subject list
3.4.3. Rules and regulation
3.4.4. Quiz page
3.4.5. Answer sheet
3.4.6. Result
3.5. Conclusion
4. Simple Login Page Using Struts On Web
Server
4.1. Introduction
4.2. Requirements
4.2.1. Technologies Used
4.2.2. Software System Attributes
4.3. Analysis and Design
4.3.1. Data Flow Diagram
4.4. User Interface
4.4.1. Login Page
4.4.2. Success page
4.4.3. Failure Page
4.5. Conclusion
5. Bibliography

INTRODUCTION

The report has been prepared as a part of the Summer


Training Program at Wipro Ltd. Wipro Technologies is a
number 1 provider of integrated business, technology,
consulting, testing and process solution on a global
delivery platform. From vegetable oil business in
Amalner to a Global Corporation, what makes Wipro
what it is today. Wipro has many subsidiaries as Wipro
Consumer Care & Lighting, Wipro Technologies, Wipro
InfoTech, and Wipro Infrastructure Engg.

The project entrusted during the training are as:-


1. To develop a quiz system on java using java AWT
2. To make a simple login page using struts on web
server.
These entire projects require the basic knowledge
about Java.

Feasibility Study

1.) ECONOMIC FEASIBILITY

Economic analysis is most frequently used for evaluation


of the effectiveness of the system. More commonly knows
as cost/benefit analysis the procedure is to determine the
benefit and saving that are expected from a system and
compare them with costs, decisions is made to design and
implement the system. This part of feasibility study gives
the top management the economic justification for the new
system. This is an important input to the management the
management, because very often the top management
does not like to get confounded by the various
technicalities that bound to be associated with a project of
this kind. A simple economic analysis that gives the actual
comparison of costs and benefits is much more
meaningful in such cases.
In the system, the organization is most satisfied by
economic feasibility.
Because, if the organization implements this system, it
need not require any additional hardware resources as
well as it will be saving lot of time.

2.) TECHNICAL FEASIBILITY

Technical feasibility centers on the existing manual


system of the test management process and to what
extent it can support the system. According to feasibility
analysis procedure the technical feasibility of the system is
analyzed and the technical requirements such as software
facilities, procedure, inputs are identified. It is also one of
the important phases of the system development
activities. The system offers greater levels of user
friendliness combined with greater processing speed.
Therefore, the cost of maintenance can be reduced.
Since, processing speed is very high and the work is
reduced in the maintenance point of view management
convince that the project is operationally feasible.

3) BEHAVIOURAL FEASIBILITY

People are inherently resistant to change and computer


has been known to facilitate changes. An estimate should
be made of how strong the user is likely to move towards
the development of computerized system. These are
various levels of users in order to ensure proper
authentication and authorization and security of sensitive
data of the organization.

3.1. Introduction
Quiz System is basically a multiple choice quiz on various
topics of Java such as Java, JDBC, Servlets and Java
Beans. This quiz will make the user to enhance his
knowledge about Java and it will help the user to know
how much he has the knowledge about Java.
The project is build using java AWT. AWT is an Abstract
Windowing Toolkit. It contains all classes to write the
program that interface between the user and different
windowing toolkits. The AWT package is use to develop
user interface objects like buttons, checkboxes, radio
buttons and menus etc.
The AWT was designed so that programmers don’t have
worry about the details of tracking the mouse or reading
the keyboard, nor attend to the details of writing to the
screen. The AWT provides a well-designed object-
oriented interface to these low- level services and
resources. The AWT was designed to provide a common
set of tools for GUI design that work on a variety of
platforms. The user interface elements provided by the
AWT are implemented using each platform’s native GUI
toolkit, thereby

preserving the look and feel of each platform. This is one


of the strongest points of AWT. The disadvantage of this is
that a GUI designed on one platform is different when run
on another platform.

Java 1.1 AWT event model, which takes a much clearer,


object-oriented approach, along with the addition of
JavaBeans, a component programming model that is
oriented toward the easy creation of visual programming
environments. Java 2 (JDK 1.2) finished the
transformation away from the old Java 1.0 AWT by
essentially replacing everything with the Java Foundation
Classes (JFC), the GUI portion of which is called "Swing."
These are a rich set of easy-to-use, easy-to-understand
JavaBeans that can be dragged and dropped (as well as
hand programmed) to create a reasonable GUI.
Purpose :
The purpose of building JAVA QUIZ WORLD is that it will
help the user to enhance his knowledge about Java. The
user can test him and can generate a result. The main
objective of this is that the user can test and generate his
result by saving a lot of time.
The papers are according to the user convenience and
time saving. The user does not need any extra paper or
pen. He just need a basic knowledge about Java.

Scope:
The scope of this project is broad then manually taking
quiz:
• It can be used in educational institute as well as in
cooperate world to evaluate them on what they have
learnt and generate the result.
• It can be used anywhere at anytime
• No restriction that examiner has to check the quiz
• It is a self evaluating quiz.

Overview:
➢ Login
➢ Test
➢ Result

Login:
There is a quality login window in which the candidate
has to enter the userid and this is more secure than
other. In this the user has to give just it id so that he
can enter the quiz.
Test:
This page consists of choice of subject on which the
user wants to take the quiz. After selecting the subject
the user moves to the rules and regulation page. Over
there if he want to change his subject then he can go
back and change it. Then the main page starts where
quiz is written. Here he has to answer the question
and then he is moved to answer sheet where he can
see whether he marked answers correct or not.

Result:
After taking quiz the result page appears. On this
page the user came to know what was the result and
how many correct answers he has given and whether
he is pass or fail.
3.1. Functional
Requirements
Required project is for taking Java World Quiz and
providing immediate results. The system should satisfy the
following requirements:
• User Aspects:
1. Logging into the system by userid
2. Selecting the subject for quiz
3. Appearing for test
4. Reviewing the answers
5. Viewing the result at the end of examination
6. Closing the system

 Technologies Used
➢ Java Awt for programming the code.
➢ MS Access as database as it is easy to build
tables in this.
➢ SQL as querying language.

• Software
 Eclipse or Web Logic for java coding
• Hardware
The minimum hardware requirements are:
 Processing speed: 1.6 GHz
 1 GB RAM
 Minimum hardware depending on operating
system used
 True color visual display unit

 Software System
Attributes

Secure:
The user can view only the test result of its
own. He can only access his result

Availability:
The test is available any time for the user.
The basic constraint is that it is not a web
application. So, user has to load this test on his
system.

3.2. Analysis and Design


3.3.1. Use Case Diagram:
 Use case overview

System
Login with user id
 Appear for test

Select subject from list

Read rules & regulation


login

Appear for Subject


Select test
User

Select Test
Generate result

Answer Question
 Generate Result Use Case

Check answer

Calculate answer

Generate result
Count correct answer

pass fail

system

Marks= total- no of wrong


answer
3.3.2. Data Flow Diagram
User_table

lo g in

user exam

Result ja v a

Java bean
jdb c
ser vle t

Calcu la te r esu lt
3.3.3. Database Design
Table: question
Qno Number
Question Varchar(50)
Topic Varchar(50)
Option1 Varchar(50)
Option2 Varchar(50)
Option3 Varchar(50)
Option4 Varchar(50)
Correct answer Varchar(50)

Table: student
Stdno Number
Topic Varchar(50)
Tota marks Number
Marks obtained Number
Result Varchar(50)
3.2. User Interface
3.4.1. Login page
This is made for authentication.
3.4.2. Subject list page
3.4.3. Rules & Regulation
page
3.4.4. Quiz Page
3.4.5. Answersheet page
3.4.6. Result Page
Conclusion

Thus the project is a quiz system


used to test human knowledge
about a particular subject and
enhance his knowledge.
4. Simple login page
using struts on web
server
4.1. Introduction
Login page is developing using struts. Struts are a
open source framework for web applications that
integrate with standard technologies such as Java
Servlet, JavaServerPages and JavaBeans. Struts
offer many benefits to the web application
developer, including Model 2 implementation of
Model-View-Controller (MVC) design patterns in
JSP web applications. The MVC Model 2
paradigm applied to web applications let you
separate display code from flow control logic.
➢ The Model portion of an MVC-based system
typically comprises JavaBean classes that define the
internal state of the system; they also specify the
actions that can be taken to change that state. If you
use the BC4J data access framework, this layer
implements the model entirely for you. Otherwise,
you will need to create the classes that implement
your model.
➢ The View portion of a Struts-based application is
generally constructed using JSP technology. JSP
pages can contain static HTML (or XML) text called
"template text", plus the ability to insert dynamic
content based on the interpretation (at page request
time) of special action tags. The JSP environment
includes a set of custom JSP tag libraries (such as
the Struts tag libraries), standard JSP action tags
(such as those described in the JavaServer Pages
Specification), and a facility to install your own JSP
custom tag libraries. If you use the BC4J data
access framework, you can take advantage of
JDeveloper’s JSP generation wizards and the
custom tag libraries that allow your JSP pages to
display data bound dynamic content.
➢ The Controller portion of the application is focused
on receiving requests from the client (typically a user
running a web browser), deciding what business
logic function is to be performed, and then
delegating responsibility for producing the next
phase of the user interface to an appropriate View
component. In Struts, the primary components of the
Controller is a servlet of class ActionServlet and the
Class RequestProcessor. If you use the BC4J data
access framework, the RequestProcessor is
extended for you and is known as the BC4J Request
Processor.
MVC Architecture

controller

Enterprise
H Servlet service
Request
bus
T Model

T Bean
P view

JSP Databas
e

App Server Server


Response Web
serve
Struts framework

Struts 2. Create form Action


Servlet 3. Apply HTML Parms Form
s
Class
4. Validate
1.Request

5. Execute
HTML
tags 6. Forward Action
return forward sub
class

7. HTML responses JSP


Purpose:
The purpose of building such an application is that to
authenticate. Login page provide the user to login
successfully. This will help the user to authenticate its data
and successfully login. This login page helps in easy login
and makes the work easier.

Scope:
The scope of this is that it will help in making the easy
login and can be used anytime anywhere.
It will authenticate the user.

Overview:
➢ Login
➢ Success
➢ Failure
Login:
Model is basically data of you application. A collection of
Java beans and other helper classes that you use for
your application
In Login Form Example ,the following classes will be
used--
1. Action class
2. ActionForm class
Action Class:
The action class is the link between the Struts framework
and your business application logic. The purpose of Action
Class is to translate the HttpServletRequest to the
business logic. In this our Action class is
LoginAction.java. this Action class only forwards the
login.jsp. Our Action class returns the
ActionForward called "loginAction", which is defined in the
struts-config.xml file. Action Class process the specified
HTTP request, and create the corresponding HTTP
response and Return an ActionForward instance
describing where and how control should be forwarded. In
our login action class if username field value will be
'username' and password will be 'password' then the
mapping will forward to success.jsp otherwise to
failure.jsp.
ActionForm Class:
An ActionForm is a JavaBean that extends
org.apache.struts.action.ActionForm. ActionForm
maintains the session state for web application and the
ActionForm object is automatically populated on the
server side with data entered from a form on the client
side. It must have setters and getters for all the form
fields.The ActionForm class is pre-populated with form
data when the form is submitted.
In this our ActionForm class is LoginForm.java.
View Part of Login form Example :
The View portion of a web application is most often
constructed using JavaServer Pages (JSP).JSP pages
can contain static HTML (or XML),plus the ability to insert
dynamic content based on the interpretation of special
action tags.
In this our JSP pages are login.jsp, success.jsp,
failure.jsp.
Controller Part of Login form Example:
The Controller part is focused on receiving requests from
a web browser, deciding what business logic function is to
be performed, and then delegating responsibility for
producing the next phase of the user interface to an
appropriate View component. The main component of the
Controller in the framework is a servlet of class
ActionServlet. This servlet is configured by defining a set
of ActionMappings.Defining the mapping for our example.
Put the following code in struts-config.xml.
Put the following codes within the <form-beans> ---------
</form-beans> section.
<form-bean
name="LoginForm"
type="com.user.LoginForm"/>
</form-beans>
Put the following codes within the <action-mappings>
--------- </action-mappings> section.
<action
path="/Login"
type="com.user.LoginAction"
name="LoginForm"
scope="request"
validate="true"
input="/pages/login.jsp">
<forward name="success"
path="/pages/success.jsp"/>
<forward name="failure" path="/pages/failure.jsp"/>
</action>
How to run the example:-
Installing Struts Application:
Download latest version of Struts from the site of
Struts http://jakarta.apache.org/struts. Copy struts-
blank.war to tomcat webapps directory. Start
tomcat, Tomcat automatically extracts the file and
loads the application.

3.1. Functional
Requirements
Required project is for taking Login Page and providing
immediate results. The system should satisfy the following
requirements:
 User aspects:
1. user will simply login the page
2. after that the user will went to success page if
correct.

4.2.1. Technologies Used


➢ Hardware:
The minimum hardware requirements are:
 Processing speed: 1.6 GHz
 1 GB RAM
 Minimum hardware depending on operating
system used
 True color visual display unit.

➢ Software:
 The language used are JSP and Java
 The XML is used as it is more compatible
with web server.
 Apache Tomcat 5.5 as a web server.
4.2.2. Software System
Requirements
 Secure
 Reliable
 Portable
 Available

3.1. Analysis and Design


4.3.1. Data flow diagram

user
success
L o g in
failure

3.2. User Interface

Login Page
Success page
Failure page
if the user name and password did not match the user
will be forwarded to the failure page. Lets try entering
"Joe" as the user name and "Eswar" as the password,
the following page will be displayed to the user.

Conclusion
Thus it is a simple login page made using web
application which provides simple and easy login
facility.
The project is a module for me to learn the simple web
application and latest technology used.

Bibliography:
Resource URL
 Struts http://jakarta.apache.org/struts/
 Apache Tomcat http://tomcat . apache .org
 MySQL http://www.mysql.com
Books:
 Thinking in java
 Struts tutorial

Anda mungkin juga menyukai