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

Omkar.V.Choudhari Internship Report

Intern
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

Omkar.V.Choudhari Internship Report

Intern
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47

JHULELAL INSTITUTE OF TECHNOLOGY

NAGPUR

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

INTERNSHIP REPORT
SESSION 2023-2024

IT-NetworkZ Infosystems Pvt. Ltd.


(Kavin India Pvt. Ltd.)

TECHNICAL HEAD: PRESENTED BY:


Mr. Rajiv Verma Omkar.V.Choudhari

IT-NETWORKZ INFOSYSTEMS PVT.LTD 1|Page


DECLARATION

During my internship in IT-NetworkZ Infosystems Pvt. Ltd and preparation of this report I
realized that it is the joint venture guidance, assistance and co-operation. So, it would have not
been completed without and declaration and help received. It is matter of great privileges to
express my deep sense of gratitude towards my guide Mr. Rajiv Verma at IT-NetworkZ
Infosystems Pvt. Ltd Nagpur. For having this guidance, I am extremely thankful to him for
constant motivation and inspiration extended throughout during internship work which has made
me possible to complete the work in scheduled time. My sincere thanks to all the faculties.

Submitted By:

Omkar.V.Choudhari

IT-NETWORKZ INFOSYSTEMS PVT.LTD 2|Page


ACKNOWLEDGEMENT

I have taken efforts in the project. However, it would not have been possible
without the kind and help of support and help of many individual and organizations
would like to extend my sincere thanks to all of them.

I am highly indebted to Mr. RajivVerma for their guidance and constant


supervision as well as for providing necessary information regarding the project &also
for their support in completing the project. I would like to express my gratitude toward
my parents & members of IT-NetworkZ Infosystems Pvt. Ltd. for their kind co-
operation and encouragement which help me in completion of this project.

I would like to give my special gratitude and thanks to industry persons for
giving me such attention and time.

My thanks and appreciation also go to my colleague in developing the project


and people who have willingly helped me out with their abilities.

TECHNICAL HEAD: PRESENTED BY:


Mr. Rajiv Verma Omkar.V.Choudhari

IT-NETWORKZ INFOSYSTEMS PVT.LTD 3|Page


INDEX

Topics

Chapter 1: Introduction to WEB APPLICATION.


Chapter 2: Introduction to DYNAMIC WEB
APPLICATION.

Chapter 3: HTML Tags.

Chapter 4: DATABASE (Installation &


Configuration).

Chapter 5: SERVLET (Server-Side Technology).

Chapter 6: Introduction to MVC architecture.

Chapter 7: View designing using HTML and JSP


pages.

IT-NETWORKZ INFOSYSTEMS PVT.LTD 4|Page


COMPANY INFORMATION
Name: IT-NetworkZ Infosystems Pvt. Ltd.

INTRODUCTION

Ms IT-NetworkZ is an IT Company and part of Information Technology


industry, it was set on 22 May 2007. IT NetworkZ started its operations with
Information Technology services including IT Infrastructure Management and
Professional IT Training & Online Exam Facility, later in Dee 2009, company
established Software Development wing well On26 June 2015 Company was
incorporated as 'IT-NetworkZ Infosystems Pvt Ltd Company has its presence in
India & in South Africa, its head office is situated in Laxmi Nagar) and branch
offices are at Nandanvan-Nagpur, Cape Town & Johannesburg-South Africa.
Company is running its all operations independently as per their Geographic
area India operations are handled by a team of 20-25 professionals.

SERVICE CATEGORIES:

1) IT Training & International Assessment:

IT Network has very strong bonding with educational institutions and hence
established around 28- MoU's with esteemed Institutions which comes under
MSBTE, UGC and AICTE, these MoU are done for students & faculty
development. Technical team members GENwork have fine experience and
keen interest in teaching Company has trained around 4000+ candidates
under its banner and usually 7200+ students attend IT- NetworkZ Tech
sessions every year. IT NetworkZ is an Ex-authorized Prometric and
Pearson VUE test centre for International IT Exams. Currently, it is
authorized by "Kryterion Testing Network for reputed Sales Force and other
IT international exams; IT giant "Persistent Systems Ltd had taken an
initiative with company to start this facility for needy candidates.

2) Live Project & Internships:

IT-NETWORKZ INFOSYSTEMS PVT.LTD 5|Page


Live Project Internship turns student into professionals. Being a part of IT
Industry IT Network Management started with this initiative to produce more
quality and Industry ready professionals Company is providing 6 Weeks, 6
Months & 1 Year Internship / Live projects for Final Year and Graduate
Candidates

3) Software Development:

IT-Network has a term of enthusiastic and creativity developers and


designers Company is providing stand alone, web applications and mobile
app developmentto various clients till now company has completed various
projects and working for some of the esteemed clients in Hospitality,
Education, and Government sector. As per the market demand and own
strength company has planned service-based solutions in Matrimony,
Employment, Education Listing Electronics Test System Venue Searching,
etc Company is planning to develop few solutions for health care industry as
well as professionals Company is providing 6 Weeks, 6 Months &1
Internship /Live for Final Year and Graduate Candidates.

AWARDS:

1) Awarded in TOP TEN Prometric Test Centres in the world; out of 5600+ Centre's for
theyear2013-14.
2) Microsoft Network Partner
3) 700-Tech Session Delivered to 20,000-Students

PRODUCTS:

Microsoft Dot Net

Virtualization Cloud

CCNA

Linux

Hardware

Security

IT-NETWORKZ INFOSYSTEMS PVT.LTD 6|Page


Chapter 1: Introduction to WEB APPLICATION.

1.1 What is a Web Application?


In this tutorial, we will learn the basic concepts of a web
application, how it works, its advantages and disadvantages.

1.2 Definition of Web-application


A web-application is an application program that is usually stored
on a remote server, and users can access it through the use
of Software known as web-browser.

IT-NETWORKZ INFOSYSTEMS PVT.LTD 7|Page


1.3 Another definition
It is a type of computer program that usually runs with the help of
a web browser and also uses many web technologies to perform
various tasks on the internet.
A web application can be developed for several uses, which can
be used by anyone like it can be used as an individual or as a
whole organization for several reasons.
In general, a web application can contain online shops (or we can
also say them e-commerce shops), webmail's, calculators, social
media platforms, etc. There is also some kind of web application
that usually requires a special kind of web browser to access them.
We cannot access those kinds of web applications by using
regular web- browsers. However, most of the web applications
available on the internet can be accessed using a standard web
browser.

If we talk about the web application in general, a web application


usually uses a combination of the server-side scripts such as PHP,
ASP, for handling the information/ data storage and retrieval of the
data.

Some of them also use the client-side scripts such


as JavaScript, HTML to represent the data/information in front of
the users, and some of the web applications are also using
both server-side and client-side at the same time.

It allows the users to communicate with the organization or


companies by using the online form, online forums, shopping carts,
content management system, and much more.

Let's understand the working of the web-application.

IT-NETWORKZ INFOSYSTEMS PVT.LTD 8|Page


1.4 How does a web- application work?
In general, web-application does not require downloading them
because, as we already discussed, the web application is a
computer program that usually resides on the remote server. Any
user can access it by using one of the standard web browsers
such as Google Chrome, Safari, Microsoft Edge, etc., and most
of them are available free for everyone.

A web application are generally coded using the languages


supported by almost every web-browsers such as HTML,
JavaScript because these are the languages that rely on the web
browsers to render the program executable.

Some of the web applications are entirely static due to which they
not required any processing on the server at all while, on the other
hand, some web applications are dynamic and require server-side
processing.

To operate a web- application, we usually required a web server


(or we can say some space on the web-server for our
programs/application's code) to manage the clients' upcoming
requests and required an application server.

The application server performs the task that requested by the


clients, which also may need a database to store the information
sometimes. Application server technologies range from ASP.NET,
ASP, and ColdFusion to PHP and JSP.

To create the web applications script, server-side programming is


done by using programming languages such as Java, Python,
PHP, and Ruby, etc. Python and Java are the languages that are
usually used for server-side programming.

IT-NETWORKZ INFOSYSTEMS PVT.LTD 9|Page


1.5 The Flow of the Web Application
Let's understand how the flow of the typical web application looks
like.

1. In general,a user sends a request to the web-server using


web browsers such as Google Chrome, Microsoft Edge,
Firefox, etc over the internet.
2. Then, the request is forwarded to the appropriate
web application server by the web-server.

IT-NETWORKZ INFOSYSTEMS PVT.LTD 10 | P a g e


3. Web application server performs the requested operations/
tasks like processing the database, querying the
databases; produces the result of the requested data.
4. The obtained result is sent to the web-server by the web
application server along with the requested data/information
or processed data.
5. The web server responds to the user with the requested or
processed data/information and provides the result to the
user's screen .

1.6 Benefits of a web application


Let see some of the significant benefits offered by a web
application:

o Any typical web application can run or accessible on any


operating system such as the Windows, Mac, Linux as long
as the browser is compatible.
o A web application is usually not required to install in the hard
drive of the computer system, thus it eliminates all the issues
related to the space limitation.
o All the users are able to access the same version of the web
application, which eliminates all compatibility issues.
o It also reduces software piracy in subscription-based web
applications, for example, SAAS (or Software as a service).
o They also reduce the expense for end-users, business
owners because the maintenance needed by the business is
significantly less.

IT-NETWORKZ INFOSYSTEMS PVT.LTD 11 | P a g e


o Web applications are flexible. A user can work from any
geographical location as long as he has a working internet

1.7 Disadvantages of the Web Applications


As we all know, there are two sides of anything; if something has
some advantages, it may also have limitations/ disadvantages.
Consider the following disadvantages of the web applications.

o Internet connection is necessary to access any web


application, and without an internet connection, anyone can't
use any of the web applications. It is very typical to get an
internet connection in our modern cities, still rural area
internet connectivity not so well.
o Several people in business believe that their data on the
cloud environment is no that secure and likes to stick with old
methods; they even don't want to use new methods.
o As we all know that many users like to use different web
browsers according to their needs and choices. So while
creating a web application, you must remember that your
application must support several web browsers, including
new and old versions of browsers.
o Speed-related issues are also affecting the web application's
performance because there are several factors on which the
performance of a web application depends, and these all
factors affect the performance of the web application in their
own way.

IT-NETWORKZ INFOSYSTEMS PVT.LTD 12 | P a g e


Chapter 2:
Introduction to DYNAMIC
WEB APPLICATION
2.1 What is a dynamic web application?
A dynamic web application is a type of application that can
change its content, appearance, and functionality in
response to user input, system events, and information.
Dynamic web applications may make use of features such
as load-time data-driven forms, AJAX, databases, or other
services that respond to external events.

Dynamic Web Applications can change their functionality without


having to rewrite parts of their codebase. They offer developers
an opportunity to create applications that can adapt based on

IT-NETWORKZ INFOSYSTEMS PVT.LTD 13 | P a g e


user behavior and other external factors. They are made up of
three components: the backend component (the database),
client-side components, and frontend components. These pieces
work together to enable users to interact with a DWA, which can
change over time just like it does in any other dynamic application.

2.2 Examples of Dynamic Web


Applications
A dynamic web application is a web application that can be
offered under various configurations, depending on the needs of
the user. These applications can present themselves differently to
specific users based on authentication and other factors. Some
examples of dynamic web applications are social media sites like
Facebook, Twitter, and forums. These sites not only show
different content to people who log in using different means, but
they also provide interactivity between users and allow them to
express their personalities by posting pictures or writing
comments.

1. YouTube

IT-NETWORKZ INFOSYSTEMS PVT.LTD 14 | P a g e


When you search for something on YouTube. YouTube sends a
request to the server, which returns results for your search.
Following that, new content will be displayed on the website. This
is a pretty good example of a dynamic application. YouTube's
website content was dynamically updated in response to your
input.

2. Twitter

When you like a tweet on Twitter, it increases the number of likes


by one and displays the total count. Twitter calculated the number
of likes on the server and delivered the value to the client. The
updated result is then displayed by the client.

IT-NETWORKZ INFOSYSTEMS PVT.LTD 15 | P a g e


2.3 Difference Between Dynamic
and Static Web App
Static and dynamic web apps. They're all taken for granted in the
market today. Yet, they differ in what they do and how they work.
Understanding their differences is absolutely vital if you want to
fully comprehend the endless world of possibilities thematic
applications can offer your business.

Static web apps are websites that are not stored in any database
or get updated when the user visits. In static web applications, all
the data is stored in the browser. They do not require an Internet
connection to work and can be hosted anywhere users have
access to a computer or Internet connection. Static websites may
have some advantages over dynamic sites, but have the
disadvantage of being difficult for users to update themselves and
analyze performance issues in most cases. There are certain
limitations with static websites such as adding features, fixing
bugs and importing users' information from another database or
application that connects with it. Despite the fact that static
website needs minimal development costs (no database setup),
they are more secure as they cannot be modified by bad people
easily and if security policies also hide their complexity from them
(i.e.), they are easy to use by people who know nothing about
web development yet need their sites working just fine without
knowledge of programming languages like JavaScript, HTML,
and CSS required for dynamic ones.

Dynamic web apps are well-known as an alternative to static


websites. Dynamic web applications are based on models,
business rules, and data stored in the backend. Dynamic web
apps allow you to respond to user input in real time, so
transactions can take place instantly. Static web applications are

IT-NETWORKZ INFOSYSTEMS PVT.LTD 16 | P a g e


more traditional, where static pages are viewed unchanged by
users each time they visit the website.

Both dynamic and static web apps are used in the development
of websites. Dynamic is a type of methodology that makes it easy
for you to change the content on your web page. It also allows
you to generate new HTML code automatically without saving or
saving it into an external file. Dynamic web apps work by using
server-side languages to retrieve data from a database or other
application, manipulate it and respond in an adequate way. Static
web apps do not require any sort of programming, since they
only use information from files on disk (browser).

2.3.1Static website

 The page's content will not change unless the site's owner
updates it.
 The user is unable to interact with the web page, such as
commenting on the post, liking the post, searching for content,
and so on.
 No need for database or server
 Less expensive

2.3.2Dynamic web app

 Without the requirement of the site owner, content changes


dynamically based on user interaction
 The user can interact in a variety of ways.
 Need a server and database

IT-NETWORKZ INFOSYSTEMS PVT.LTD 17 | P a g e


 Can be expensive to build
Both dynamic and static web apps are used in the development
of websites. Understanding their differences is absolutely vital if
you want to fully comprehend the possibilities thematic
applications can offer your business. Dynamic web apps allow
you to respond to user input in real time, so transactions can take
place instantly. Static web applications are more traditional,
where static pages are viewed unchanged by users each time
they visit the website.

2.4 Benefits of dynamic web


application
In today's fast-paced world, everything is moving at an incredible
speed and we are expecting the future to be even more dynamic
and faster than the present. A dynamic web application is one of
the most recent innovations in website development. Dynamic
web applications can change their design, appearance, and
functionality to match their users' expectations or the current
context or environment. The most popular use of dynamic web
applications is on mobile smartphones and other small devices
that have limited resources for running heavy desktop
applications. How can they help in providing a solution to the
problems that businesses face these days? So, what are their
benefits and how can you take advantage of this innovative
technology?

A dynamic web application is a web application that dynamically


generates pages based on some pre-established rules. By
default, most sites on the internet use static pages. Imagine
having to make all those switches manually every time you want
to create a page! That would be very time-consuming and
resource-consuming for a proper website. DWA has made it
easier for developers and designers to create applications that

IT-NETWORKZ INFOSYSTEMS PVT.LTD 18 | P a g e


run across different types of devices. Although there are plenty of
technical specifications involved if you take a closer look at
dynamic web applications, one thing stands out at first glance
that is its functionality and user experience.

Web application development has come a long way in the last


few years. Gone are the days of static websites that required you
to code everything by hand. Dynamic web applications (DWA)
make it possible to develop rapidly while delivering immediate
results as soon as they are published. How? There's no need to
build everything from scratch or actually change what is already
there once you publish; dynamic web apps push content to live
with minimal fuss. As we all know this can be a real boon for
businesses that need a website for their business but don't want
to spend unnecessary time, money, and resources on
developing the site.

2.5 Conclusion
A dynamic web application (DWA) is a web application that
requires the use of Javascript to deliver content to the browser. It
can be built either as a single-page application or as a more
traditional website with multiple pages and multiple levels of site
navigation. Dynamic web applications may make use of features
such as load-time data-driven forms, AJAX, databases, or other
services that respond to external events. Static web apps are
websites that are not stored in any database or get updated
when the user visits. They do not require an Internet connection
to work and can be hosted anywhere users have access to a
computer or Internet connection.

IT-NETWORKZ INFOSYSTEMS PVT.LTD 19 | P a g e


Chapter 3:
HTML Tags.

3.1 What Is HTML?


HTML, which stands for Hypertext Markup Language, is the
language used to describe structured documents and the
language used to create web pages on the internet.

You can use any text editor to write the HTML code, such
as Notepad (PC) or TextEdit (Mac). For our demonstration, we
will use a sublime text editor, which you can download
at https://www.sublimetext.com/3.

Save the file with the .html extension, and open it using a web
browser of your choice.

IT-NETWORKZ INFOSYSTEMS PVT.LTD 20 | P a g e


HTML tags are the keywords on a web page
that define how your web browser must
format and display your web page.
Almost all tags contain two parts, an opening,
and a closing tag. For example, <html> is
the opening tag and </html> is the closing
tag. Note that the closing tag has the same
text as the opening tag, but has an
additional forward-slash ( / ) character.
There are a total of 100 HTML tags. We will
divide them into categories and discuss the
important ones in this article.
3.2 Basic HTML Tags
Head Tag
The head tag <head> contains all the
elements describing the document.
Title Tag
The title tag <title> specifies the HTML page
title, which is shown in the browser’s title
bar.
Body Tag

IT-NETWORKZ INFOSYSTEMS PVT.LTD 21 | P a g e


The body tag <body> is where you insert
your web page’s content.
Paragraph Tag
A paragraph tag <p> is used to define a
paragraph on a web page.
Heading Tag
The HTML heading tag is used to define the
heading of the HTML document. The <h1>
tag defines the most important tag, and
<h6> defines the
least.

IT-NETWORKZ INFOSYSTEMS PVT.LTD 22 | P a g e


3.3 Formatting Tags
Emphasis tag
The HTML <em> tag is used to emphasize
the particular text in a paragraph.
Bold Tag
The <b> tag is used to make the text bold.
Italic Tag
The <i> tag is used to make the text italic.
Underline Tag
The <u> tag is used to set the text underline.

IT-NETWORKZ INFOSYSTEMS PVT.LTD 23 | P a g e


3.4Link Tag
The <a> tag links one page to another page.
The href attribute is used to define

IT-NETWORKZ INFOSYSTEMS PVT.LTD 24 | P a g e


3.5 The Table Tag
The <table> tag is used to create a table in
the HTML document.
The table row (<tr>) tag is used to make the
rows in the table, and the table data (<td>)
tag is used to enter the data in the table.
IT-NETWORKZ INFOSYSTEMS PVT.LTD 25 | P a g e
The style (<style>) tag is used to add
methods to the content
by typing

IT-NETWORKZ INFOSYSTEMS PVT.LTD 26 | P a g e


Chapter 4

Database (Installation & Configuration)

4.1 How to install MySQL


MySQL is one of the most popular relational database
management software that is widely used in today's industry. It
provides multi-user access support with various storage engines.
It is backed by Oracle Company. In this section, we are going to
learn how we can download and install MySQL for beginners.

Prerequisites

The following requirements should be available in your system to


work with MySQL:

o MySQL Setup Software


o Microsoft .NET Framework 4.5.2
o Microsoft Visual C++ Redistributable for Visual Studio 2019
o RAM 4 GB (6 GB recommended)

Download MySQL
Step 1: Go to the official website of MySQL and download the
community server edition software. Here, you will see the option to
choose the Operating System, such as Windows.

Step 2: Next, there are two options available to download the


setup. Choose the version number for the MySQL community
server, which you want. If you have good internet connectivity,
then choose the mysql-installer-web-community. Otherwise,
choose the other one.

IT-NETWORKZ INFOSYSTEMS PVT.LTD 27 | P a g e


Installing MySQL on Windows
Step 1: After downloading the setup, unzip it anywhere and
double click the MSI installer .exe file. It will give the following

Step 2: In the next wizard, choose the Setup Type. There are
several types available, and you need to choose the appropriate
option to install MySQL product and features. Here, we are going
to select the Full option and click on the Next button.

IT-NETWORKZ INFOSYSTEMS PVT.LTD 28 | P a g e


This option will install the following things: MySQL Server, MySQL
Shell, MySQL Router, MySQL Workbench, MySQL Connectors,
documentation, samples and examples, and many more.

Step 3: Once we click on the Next button, it may give information


about some features that may fail to install on your system due to
a lack of requirements. We can resolve them by clicking on
the Execute button that will install all requirements automatically
or can skip them. Now, click on the Next button.

Step 4: In the next wizard, we will see a dialog box that asks for
our confirmation of a few products not getting installed. Here, we
have to click on the Yes button.

IT-NETWORKZ INFOSYSTEMS PVT.LTD 29 | P a g e


After clicking on the Yes button, we will see the list of the products
which are going to be installed. So, if we need all products, click
on the Execute button.

Step 5: Once we click on the Execute button, it will download and


install all the products. After completing the installation, click on
the Next button.

IT-NETWORKZ INFOSYSTEMS PVT.LTD 30 | P a g e


Step 6: In the next wizard, we need to configure the MySQL
Server and Router. Here, I am not going to configure the Router
because there is no need to use it with MySQL. We are going to
show you how to configure the server only. Now, click on the Next
button.

Step 7: As soon as you will click on the Next button, you can see
the screen below. Here, we have to configure the MySQL Server.
Now, choose the Standalone MySQL Server/Classic MySQL
Replication option and click on Next. Here, you can also choose
the InnoDB Cluster based on your needs.

IT-NETWORKZ INFOSYSTEMS PVT.LTD 31 | P a g e


Step 8: In the next screen, the system will ask you to choose the
Config Type and other connectivity options. Here, we are going to
select the Config Type as 'Development Machine' and
Connectivity as TCP/IP, and Port Number is 3306, then click on
Next.

Step 9: Now, select the Authentication Method and click on Next.


Here, I am going to select the first option.

Step 10: The next screen will ask you to mention the MySQL Root
Password. After filling the password details, click on the Next
button.

IT-NETWORKZ INFOSYSTEMS PVT.LTD 32 | P a g e


Step 11: The next screen will ask you to configure the Windows
Service to start the server. Keep the default setup and click on the
Next button.

Step 12: In the next wizard, the system will ask you to apply the
Server Configuration. If you agree with this configuration, click on
the Execute button.

IT-NETWORKZ INFOSYSTEMS PVT.LTD 33 | P a g e


Step 13: Once the configuration has completed, you will get the
screen below. Now, click on the Finish button to continue.

Step 14: In the next screen, you can see that the Product
Configuration is completed. Keep the default setting and click on
the Next-> Finish button to complete the MySQL package
installation.

IT-NETWORKZ INFOSYSTEMS PVT.LTD 34 | P a g e


Step 15: In the next wizard, we can choose to configure the
Router. So click on Next->Finish and then click the Next button.

Step 16: In the next wizard, we will see the Connect to Server
option. Here, we have to mention the root password, which we
had set in the previous steps.

IT-NETWORKZ INFOSYSTEMS PVT.LTD 35 | P a g e


In this screen, it is also required to check about the connection is
successful or not by clicking on the Check button. If the
connection is successful, click on the Execute button. Now, the
configuration is complete, click on Next.

Step 17: In the next wizard, select the applied configurations and
click on the Execute button.

IT-NETWORKZ INFOSYSTEMS PVT.LTD 36 | P a g e


Step 18: After completing the above step, we will get the following
screen. Here, click on the Finish button.

Step 19: Now, the MySQL installation is complete. Click on the


Finish button.

IT-NETWORKZ INFOSYSTEMS PVT.LTD 37 | P a g e


Chapter 5

SERVLET (Server-side Technology)

Servlet Tutorial

Servlet technology is used to create a web application (resides at


server side and generates a dynamic web page).

Servlet technology is robust and scalable because of java


language. Before Servlet, CGI (Common Gateway Interface)
scripting language was common as a server-side programming
language. However, there were many disadvantages to this
technology. We have discussed these disadvantages below.

There are many interfaces and classes in the Servlet API such as
Servlet, GenericServlet, HttpServlet, ServletRequest,
ServletResponse, etc.

What is a Servlet?
Servlet can be described in many ways, depending on the context.

o Servlet is a technology which is used to create a web


application.
o Servlet is an API that provides many interfaces and classes
including documentation.
o Servlet is an interface that must be implemented for creating
any Servlet.

IT-NETWORKZ INFOSYSTEMS PVT.LTD 38 | P a g e


o Servlet is a class that extends the capabilities of the servers
and responds to the incoming requests. It can respond to any
requests.
o Servlet is a web component that is deployed on the server to
create a dynamic web page.

What is a web application?


A web application is an application accessible from the web. A
web application is composed of web components like Servlet, JSP,
Filter, etc. and other elements such as HTML, CSS, and
JavaScript. The web components typically execute in Web Server
and respond to the HTTP request.

CGI (Common Gateway Interface)


CGI technology enables the web server to call an external
program and pass HTTP request information to the external
program to process the request. For each request, it starts a new
process.

IT-NETWORKZ INFOSYSTEMS PVT.LTD 39 | P a g e


Disadvantages of CGI
There are many problems in CGI technology:

1. If the number of clients increases, it takes more time for


sending the response.
2. For each request, it starts a process, and the web server is
limited to start processes.
3. It uses platform dependent language e.g. C, C++, perl.

IT-NETWORKZ INFOSYSTEMS PVT.LTD 40 | P a g e


There are many advantages of Servlet over CGI. The web
container creates threads for handling the multiple requests to the
Servlet. Threads have many benefits over the Processes such as
they share a common memory area, lightweight, cost of
communication between the threads are low. The advantages of
Servlet are as follows:

1. Better performance: because it creates a thread for each


request, not process.
2. Portability: because it uses Java language.
3. Robust: JVM manages Servlets, so we don't need to worry
about the memory leak, garbage collection, etc.
4. Secure: because it uses java language.

IT-NETWORKZ INFOSYSTEMS PVT.LTD 41 | P a g e


Chapter 6

Introduction to MVC architecture

MVC Architecture in Java


The Model-View-Controller (MVC) is a well-known design
pattern in the web development field. It is way to organize our
code. It specifies that a program or application shall consist of
data model, presentation information and control information. The
MVC pattern needs all these components to be separated as
different objects.

In this section, we will discuss the MVC Architecture in Java,


alongwith its advantages and disadvantages and examples to
understand the implementation of MVC in Java.

What is MVC architecture in Java?


The model designs based on the MVC architecture follow MVC
design pattern. The application logic is separated from the user
interface while designing the software using model designs.

The MVC pattern architecture consists of three layers:

o Model: It represents the business layer of application. It is an


object to carry the data that can also contain the logic to
update controller if data is changed.
o View: It represents the presentation layer of application. It is
used to visualize the data that the model contains.

IT-NETWORKZ INFOSYSTEMS PVT.LTD 42 | P a g e


o Controller: It works on both the model and view. It is used to
manage the flow of application, i.e. data flow in the model
object and to update the view whenever data is changed.

In Java Programming, the Model contains the simple Java classes,


the View used to display the data and the Controller contains
the servlets. Due to this separation the user requests are
processed as follows:

1. A client (browser) sends a request to the controller on the


server side, for a page.
2. The controller then calls the model. It gathers the requested
data.
3. Then the controller transfers the data retrieved to the view
layer.
4. Now the result is sent back to the browser (client) by the view.

Advantages of MVC Architecture


The advantages of MVC architecture are as follows:

IT-NETWORKZ INFOSYSTEMS PVT.LTD 43 | P a g e


o MVC has the feature of scalability that in turn helps the
growth of application.
o The components are easy to maintain because there is less
dependency.
o A model can be reused by multiple views that provides
reusability of code.
o The developers can work with the three layers (Model, View,
and Controller) simultaneously.
o Using MVC, the application becomes more understandable.
o Using MVC, each layer is maintained separately therefore we
do not require to deal with massive code.
o The extending and testing of application is easier.

Implementation of MVC using Java


To implement MVC pattern in Java, we are required to create the
following three classes.

o Employee Class, will act as model layer


o EmployeeView Class, will act as a view layer
o EmployeeContoller Class, will act a controller layer

IT-NETWORKZ INFOSYSTEMS PVT.LTD 44 | P a g e


Chapter 7

View designing using HTML and JSP

How TO - Create and View a Website

Step 1: Open Notepad (PC)


Windows 8 or later:

Open the Start Screen (the window symbol at the bottom left
on your screen). Type Notepad.

Windows 7 or earlier:

Open Start > Programs > Accessories > Notepad

Step 1: Open TextEdit (Mac)


Open Finder > Applications > TextEdit

Also change some preferences to get the application to save


files correctly. In Preferences > Format > choose "Plain Text"

Then under "Open and Save", check the box that says
"Display HTML files as HTML code instead of formatted text".

Then open a new document to place the code.

Step 2: Write Some HTML


IT-NETWORKZ INFOSYSTEMS PVT.LTD 45 | P a g e
Step 3: Save the HTML Page
Save the file on your computer. Select File > Save as in the
Notepad menu.

Name the file "index.htm" and set the encoding to UTF-


8 (which is the preferred encoding for HTML files).

Step 4: View the HTML Page in


Your Browser
Open the saved HTML file in your favorite browser (double
click on the file, or right-click - and choose "Open with").

IT-NETWORKZ INFOSYSTEMS PVT.LTD 46 | P a g e


IT-NETWORKZ INFOSYSTEMS PVT.LTD 47 | P a g e

You might also like