Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
on
BACHELOR OF TECHNOLOGY
In
by
Mohak Mahajan
2019-2020
DECLARATION
This is to certify that the Project entitled “Web development using Spring Framework” in
partial fulfillment of the requirement for the award of the Degree of Bachelor of
Technology in Computer Science & Engineering, submitted to DIT University,
Dehradun, Uttarakhand, India, is an authentic record of my own work carried out during
the period (month) 2018 to (month) 2018, under the supervision of Mr. Satheesha B
Nanjappa.
The matter embodied in this Project has not been submitted for the award of any other
degree or diploma to any University/Institution.
Signature
Name of Candidate
Mohak Mahajan
Roll No:
160113022
Date:
11 April 2020
Place: Dehradun
-2-
-3-
ACKNOWLEDGEMENT
This has been the light of the day due to invaluable contribution of certain individuals whose
constant guidance, support and encouragement resulted in the realization of our project. I
would like to take this opportunity to thank the Head of Department of Computer Science
and Engineering, Dr. Vishal Bharti, HOD CSE, DIT University for making the industrial
training a part of the Curriculum and possible for the students.
The summer internship at Infosys is a golden opportunity for learning and self- development.
I consider myself very lucky and honoured to be able to be a part of it and have so many
wonderful and experienced people lead me through the completion of this project. It gives me
immense pleasure and a sense of satisfaction to have an opportunity to acknowledge and to
express gratitude to those who were associated with me during my internship.
I would also like to state that without their endless support, kind and understanding spirit
during my case presentation. The University Management and the Dean, scope for giving us
an opportunity to carry out my studies at the University.
-4-
ABSTRACT
The Spring Framework provides a comprehensive programming and configuration model for
modern Java-based enterprise applications - on any kind of deployment platform. A key
element of Spring is infrastructural support at the application level: Spring focuses on the
"plumbing" of enterprise applications so that teams can focus on application-level business
logic, without unnecessary ties to specific deployment environments.
The core features of the Spring Framework can be used in developing any Java application,
but there are extensions for building web applications on top of the Java EE platform. Spring
framework targets to make J2EE development easier to use and promotes good programming
practices by enabling a POJO-based programming model.
Apache Maven is a software project management and comprehension tool. Based on the
concept of a project object model (POM), Maven can manage a project's build, reporting and
documentation from a central piece of information.
Servlet technology is used to create a web application (resides at server side and generates a
dynamic web page).
JSP technology is used to create web application just like Servlet technology. It can be
thought of as an extension to Servlet because it provides more functionality than servlet such
as expression language, JSTL, etc.
JDBC stands for Java Database Connectivity. JDBC is a Java API to connect and execute the
query with the database.
-5-
LIST OF FIGURES
-6-
TABLE OF CONTENTS
CHAPTER PAGE
Chapter 1 -- Organization Overview 8
1.1. Introduction 8
1.2. Services provided by company 9
-7-
CHAPTER 1
ORGANIZATION OVERVIEW
Infosys is the second-largest Indian IT company after Tata Consultancy Services by 2017
revenue and 596th largest public company in the world based on revenue. On March 29,
2019, its market capitalisation was $46.52 billion. The credit rating of the company is A−
(rating by Standard & Poor's).
1.1 INTRODUCTION
Infosys was established by seven engineers in Pune, Maharashtra, India with an initial capital
of $250 in 1981. It was registered as Infosys Consultants Private Limited on 2 July 1981. In
1983, it relocated its office to Bangalore, Karnataka, India.
The company changed its name to Infosys Technologies Private Limited in April 1992 and to
Infosys Technologies Limited when it became a public limited company in June 1992. It was
later renamed to Infosys Limited in June 2011.
Its shares were listed on NASDAQ in 1999 through ADR route. The share price surged to
₹8,100 (equivalent to ₹28,000 or US$390 in 2019) by 1999 making it the costliest share on
the market at the time. At that time, Infosys was among the 20 biggest companies by market
capitalization on the NASDAQ. The ADR listing was shifted from NASDAQ to NYSE
Euronext to give its European investors better access to its stock.
-8-
1.2 SERVICES PROVIDED BY COMPANY
One of its known products is Finacle which is a universal banking solution with various
modules for retail & corporate banking.
• Skava
-9-
CHAPTER 2
A web application is a software application that runs on a remote server. In most cases, Web
browsers are used to access Web applications, over a network, such as the Internet. Some
web applications are used in intranets, in companies and schools, for example. Web
applications are different from other applications because they do not need to be installed.
Some example web applications are: Facebook (social networking), Flickr (photo sharing),
Mibbit (chatting), and Wikipedia.
Web applications are popular because most computer operating systems have web browsers.
Programmers can easily change a web application. Users do not need to install any new
software to see these changes.
React.js is an open-source JavaScript library that is used for building user interfaces
specifically for single-page applications. It's used for handling the view layer for web and
mobile apps. React also allows us to create reusable UI components.
Backend is server side of the website. It stores and arranges data, and also makes sure
everything on the client-side of the website works fine. Java is one of the most popular and
widely used programming language and platform.
- 10 -
2.2 SKILL SET OF STUDENTS BEFORE TRAINING
My skillset before the internship was limited to the subjects, I had undertaken under the
curriculum in DIT University. I had completed several courses that helped me to get a strong
theoretical and practical base to implement the project at the facility. The skillset I acquired
from the curriculum at DIT is as follows:
This course taught me the basic concepts of web programming and internet. I learned about
the internet protocols, the use of scripting languages and appreciate their limitations. I
learned to develop web applications using basic PHP, HTML and CSS.
This course imparted the knowledge of design, implement, and use database management
systems to me. It highlighted the significant functions of database management system. I
helped me to learn and explore about advantages of using a DBMS rather than a file system,
designing an Entity-Relationship model for a real-life application, optimizing a query, basic
concepts on transaction processing, concurrency control and recovery and storage of
databases and techniques to access them using various algorithms. As an outcome of this
course I was able to determine the role of a database management system in an organization,
construct database queries using Structured Query Language (SQL), design and implement a
database project depending on the business requirements, considering various design issues
and implement the concept of a database transaction and related database facilities, including
concurrency control, backup and recovery.
- 11 -
Operating System:
Through the knowledge acquired from this course I was able to understand and evaluate
trade-offs between conflicting objectives in large scale system design. I was able to
understand the internal structure of the Linux and Windows operating systems and also
learned to retrieve essential system information via basic system commands. I was able to
understand about the issues related to security in the operating system. I have a clear
understanding of the subject related concepts and of contemporary issues, an ability to design
and conduct experiments, as well as to analyze and interpret data and an ability to use
techniques, skills and modern engineering tools necessary for engineering practice
Software Engineering:
- 12 -
practices and standards. On completion of this course, I was able to explain the principles of
the engineering processes in software development, implement the software development
processes activities from requirements to validation and verification, manage software
projects through activities of estimations, scheduling, quality and software maintenance.
Machine Learning:
Machine learning is an application of artificial intelligence (AI) that provides systems the
ability to automatically learn and improve from experience without being explicitly
programmed. Machine learning focuses on the development of computer programs that can
access data and use it learn for themselves.
The process of learning begins with observations or data, such as examples, direct
experience, or instruction, in order to look for patterns in data and make better decisions in
the future based on the examples that we provide. The primary aim is to allow the computers
learn automatically without human intervention or assistance and adjust actions accordingly.
Data Science:
Data science is a multi-disciplinary field that uses scientific methods, processes, algorithms
and systems to extract knowledge and insights from structured and unstructured data.[1][2]
Data science is the same concept as data mining and big data: "use the most powerful
hardware, the most powerful programming systems, and the most efficient algorithms to
solve problems".
I had learned many more subjects and courses since my admission, the above mentioned are
some of those.
- 13 -
2.3 KNOWLEDGE ACQUIRED FROM THE PROJECTS
UNDERTAKEN IN TRAINING
Servlet: Servlet technology is used to create a web application (resides at server side and
generates a dynamic web page). Servlet is a class that extends the capabilities of the servers
and responds to the incoming requests. It can respond to any requests. Servlet is a web
component that is deployed on the server to create 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.
Applications of Servlet:
• Read the explicit data sent by the clients (browsers). This includes an HTML form on
a Web page or it could also come from an applet or a custom HTTP client program.
• Read the implicit HTTP request data sent by the clients (browsers). This includes
cookies, media types and compression schemes the browser understands, and so forth.
• Process the data and generate the results. This process may require talking to a
database, executing an RMI or CORBA call, invoking a Web service, or computing
the response directly.
JSP: JSP technology is used to create web application just like Servlet technology. It can be
thought of as an extension to Servlet because it provides more functionality than servlet such
as expression language, JSTL, etc.
A JSP page consists of HTML tags and JSP tags. The JSP pages are easier to maintain than
Servlet because we can separate designing and development. It provides some additional
features such as Expression Language, Custom Tags, etc.
- 14 -
JSP technology is the extension to Servlet technology. We can use all the features of the
Servlet in JSP. In addition to, we can use implicit objects, predefined tags, expression
language and Custom tags in JSP, that makes JSP development easy.
JDBC: JDBC stands for Java Database Connectivity. JDBC is a Java API to connect and
execute the query with the database. It is a part of JavaSE (Java Standard Edition). JDBC
API uses JDBC drivers to connect with the database. There are four types of JDBC drivers:
• Native Driver,
• Thin Driver
The JDBC API uses a driver manager and database-specific drivers to provide transparent
connectivity to heterogeneous databases.
The JDBC driver manager ensures that the correct driver is used to access each data source.
The driver manager is capable of supporting multiple concurrent drivers connected to
multiple heterogeneous databases.
- 15 -
Maven: Apache Maven is a software project management and comprehension tool. Based on
the concept of a project object model (POM), Maven can manage a project's build, reporting
and documentation from a central piece of information. Using maven we can build and
manage any Java based project.
In case of multiple development teams environment, Maven can set-up the way to work as
per standards in a very short time. As most of the project setups are simple and reusable,
Maven makes life of developer easy while creating reports, checks, build and testing
automation setups.
Maven uses Convention over Configuration, which means developers are not required to
create build process themselves. Developers do not have to mention each and every
configuration detail. Maven provides sensible default behavior for projects. When a Maven
project is created, Maven creates default project structure. Developer is only required to place
files accordingly and he/she need not to define any configuration in pom.xml.
In order to build the project, Maven provides developers with options to mention life-cycle
goals and project dependencies (that rely on Maven plugin capabilities and on its default
conventions). Much of the project management and build related tasks are maintained by
Maven plugins.
Microsoft markets at least a dozen different editions of Microsoft SQL Server, aimed at
different audiences and for workloads ranging from small single-machine applications to
large Internet-facing applications with many concurrent users.
- 16 -
SQL: SQL or Structured Query Language is a domain-specific language used in
programming and designed for managing data held in a relational database management
system (RDBMS), or for stream processing in a relational data stream management system
(RDSMS). It is particularly useful in handling structured data where there are relations
between different entities/variables of the data. SQL offers two main advantages over older
read/write APIs like ISAM or VSAM. First, it introduced the concept of accessing many
records with one single command; and second, it eliminates the need to specify how to reach
a record, e.g. with or without an index.
Originally based upon relational algebra and tuple relational calculus, SQL consists of many
types of statements, which may be informally classed as sublanguages, commonly: a data
query language (DQL), a data definition language (DDL), a data control language (DCL),
and a data manipulation language (DML). The scope of SQL includes data query, data
manipulation (insert, update and delete), data definition (schema creation and modification),
and data access control. Although SQL is often described as, and to a great extent is, a
declarative language (4GL), it also includes procedural elements.
SQL was one of the first commercial languages for Edgar F. Codd's relational model. The
model was described in his influential 1970 paper, "A Relational Model of Data for Large
Shared Data Banks". Despite not entirely adhering to the relational model as described by
Codd, it became the most widely used database language.
- 17 -
Tapestry, EJB, JSF, etc. The framework, in broader sense, can be defined as a structure
where we find solution of the various technical problems.
The core features of the Spring Framework can be used in developing any Java application,
but there are extensions for building web applications on top of the Java EE platform. Spring
framework targets to make J2EE development easier to use and promotes good programming
practices by enabling a POJO-based programming model.
The technology that Spring is most identified with is the Dependency Injection (DI) flavor of
Inversion of Control. The Inversion of Control (IoC) is a general concept, and it can be
expressed in many different ways. Dependency Injection is merely one concrete example of
Inversion of Control.
SpringBoot: Spring Boot is an open source Java-based framework used to create a micro
Service. It is developed by Pivotal Team and is used to build stand-alone and production
ready spring applications.
Micro Service is an architecture that allows the developers to develop and deploy services
independently. Each service running has its own process and this achieves the lightweight
model to support business applications.
- 18 -
CHAPTER 3
GENERIC TRAINING
Java
Java is one of the most popular programming languages. Some statistics about Java are given
below:
• According to the TIOBE Programming Community Index, it has been one of the top 5
programming languages for the past several years
• The features and strengths of Java have made it suitable for applications throughout
the history of Internet, and it continues to do so even for modern applications.
- 19 -
Fig 1: Java course 1
- 20 -
Eclipse
- 21 -
SQL
The scope of SQL includes data query, data manipulation (insert, update and delete), data
definition (schema creation and modification), and data access control. Although SQL is
often described as, and to a great extent is, a declarative language (4GL), it also includes
procedural elements.
- 22 -
CHAPTER 4
STREAM TRAINING
Project Object Model is the basic unit of work in any Maven project. It is basically an XML
configuration file named pom.xml with the information about project and the necessary
configurations. It is the central configuration file of Maven.
Pom.xml is the declarative descriptor of Maven projects that should be placed in the root
folder of the project.
- 23 -
Maven
Apache Maven is a software project management and comprehension tool. Based on the
concept of a project object model (POM), Maven can manage a project's build, reporting and
documentation from a central piece of information. Using maven we can build and manage
any Java based project.
In case of multiple development teams environment, Maven can set-up the way to work as
per standards in a very short time. As most of the project setups are simple and reusable,
Maven makes life of developer easy while creating reports, checks, build and testing
automation setups.
- 24 -
Data Persistence
Data Persistence means for an application to persist and retrieve information from the non-
volatile storage.
The persistence phenomenon contains three core components Data, Medium, Storage. It is
also necessary to know what to persist, how to persist and where to persist.
Medium is the thing that is used to transfer the data from source to destination. The data is
transferred between source and destination in the serialized manner. To transfer the data
efficiently in a serial manner, the mechanism used is called Serialization. Serialization is the
method of converting all the data/object to byte stream (0’s and 1’s) to transfer the data to the
specified storage or repository.
- 25 -
JDBC
JDBC stands for Java Database Connectivity. JDBC is a Java API to connect and execute the
query with the database. It is a part of JavaSE (Java Standard Edition). JDBC API uses JDBC
drivers to connect with the database. There are four types of JDBC drivers:
• Native Driver,
• Thin Driver
The JDBC API uses a driver manager and database-specific drivers to provide transparent
connectivity to heterogeneous databases.
- 26 -
Spring framework
- 27 -
Spring IoC Containers
Spring framework provides a container for dependency injection. This container is called as
Spring IoC container. It creates, initializes, and injects the required objects. These objects
whose life cycle is managed by Spring are called as Spring beans or beans. The Spring
container needs information about objects of which class to create and how to wire them
together. This information is called as configuration metadata. It can be provided in
following ways:
• XML configuration
• Java-based configuration
- 28 -
SpringBoot
Spring Boot is a framework built on the top Spring framework that helps developers build
Spring-based applications quickly and easily. The main goal of Spring Boot is to quickly
create Spring-based applications without requiring developers to write the same boilerplate
configuration again and again.
Spring Boot forms opinions. It means that Spring Boot has some sensible defaults which you
can use to quickly build your application. For example, Spring Boot uses embedded Tomcat
as the default web container.
Though Spring Boot has its defaults, you can easily customize it at any time during your
development based on your need. For example, if you prefer log4j for logging over Spring
Boot built-in logging support then you can easily make dependency change in your pom.xml
file to replace the default logger with log4j dependencies.
• Starter Dependencies
• Automatic Configuration
- 29 -
Logging in SpringBoot
Spring Boot uses SLF4J along with Logback implementations to log messages to the console
at ERROR, WARN, and INFO level. You can easily configure logging levels, logging
format, and log file location by setting logging related properties in application.properties
file.
Spring Boot by default, logs messages at ERROR, WARN, and INFO level. You can also set
the logger levels in application.properties file by setting the property logging.level.<logger-
name>=<level> where level is one of TRACE, DEBUG, INFO, WARN, ERROR, FATAL,
or OFF. The root logger can be configured by setting logging.level.root property in
application.properties file.
By default, Spring Boot logs only to the console and does not log to files. If you want to log
messages in files in addition to the console, you need to set logging.file property in
application.properties file. The value for this property can be exact location of file or relative
to the current directory.
Once configuration is done you can get the SLF4J logger and use it as follows:
As a developer you may want to have more control over logging for debugging and
maintenance. For this you can create the logging provider specific configuration file in their
default locations, which Spring Boot will automatically use.
- 30 -
Java Persistence API
The Java Persistence API (JPA) is Java EE specification that defines how data
persistence‐related tasks are handled using object‐relational mapping (ORM) frameworks in
Java applications. It provides following features:
• Defines an API for mapping the object model with the relational model
• Provides an object query language called Java Persistence Query Language (JPQL)
for querying database.
There are multiple providers available in market which provides implementation of JPA
specification such as EclipseLink, OpenJPA, Hibernate, etc. as shown below:
- 31 -
Presentation Layer
The presentation layer of an enterprise application handles the client requests and provide
clients a visual view of the information. It also allows them to perform business functions
provided and managed by the application.
The development of the presentation layer is a challenging task these days because of
emergence of many technologies and frameworks, such as Spring Web MVC, Java Server
Faces (JSF), Angular etc.
- 32 -
Spring MVC
Spring MVC Framework is one of the most popular framework used for developing
presentation layer of enterprise web applications. It is based on MVC and front controller
design patterns. It has following features :
• It provides a mechanism to extract data from user request and mapping it to a model
class to construct an object which makes development easy and simple.
• It is view independent. You can use any technology for generating the view such as
JSP, Tiles, Theamleaf etc.
• It is action based framework. Every user request is an action to be performed with the
framework. This is achieved by mapping each request to an executable method. The
request parameters are also mapped to arguments of this method.
- 33 -
Web API Layer
Application built using different technologies can interact with each other, for example a
Java based application can send data to a.NET application.
- 34 -
RESTful Web Services
Spring provides support for creating RESTful web services using Spring MVC starting with
version 3.0. The REST controllers are different from MVC controllers because their methods
return result which can be mapped to a representation rather than a view. For this Spring 3.0
introduced @ResponseBody annotation. It tells DispatcherServlet that the result of execution
of method need not to be mapped with a view and to automatically convert the response to a
JSON string literal.
@RestController:
- 35 -
CORS - Cross-Origin Resource Sharing
For security reasons, browsers don’t allow you to make cross-origin request. Cross origin
requests are requests to those resources which resides outside the the current origin. For
example, if a document served from xyz.com makes a request to domain abc.com for some
images then this request is called as cross origin request.
When applied at the class level, the same @CrossOrigin configuration is applied to all the
@RequestMapping methods.
- 36 -
CHAPTER 5
CONCLUSION
Infosys training is considered one of the best industrial trainings across the world and to be a
part of such a training was definitely a life changing experience for me. I got a chance to
apply all the theoretical concepts which I learnt during college to practical use. It provided a
great exposure to me not only in terms of increasing my technical knowledge but also in
other aspects like communication skills, industry exposure and also giving a boost to my
professional career.
- 37 -
CHAPTER 6
FUTURE SCOPE
Due to COVID-19, our training was terminated in the middle, we could not enter the project
phase. I am, though, looking forward to working with Infosys very soon.
- 38 -
REFERENCES
• www.infosys.com
• www.tutorialspoint.com
• www.lex.infosysapps.com
• www.javatpoint.com
- 39 -