please undertand and genreate a good colelge report ppt slides with end to end ranign  between 20 - 25 slides 
"""
SKILL DZIRE 
FULL STACK JAVA INTERNSHIP 
An Internship Report Submitted at the end of seventh semester 
 
 
BACHELOR OF TECHNOLOGY 
IN 
 
COMPUTER SCIENCE AND ENGINEERING 
 
Submitted By 
PODURU CHAITANYA SAI  (213J1A05E0) 
 
 
Under the esteemed guidance of 
Dr.Srikanth Muppalla, SkillDzire and  Dr. S Om Prakash Asst. Professor   
 
 
  
 
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING 
 
                                                     RAGHU INSTITUTE OF TECHNOLOGY (AUTONOMOUS). 
Affiliated to JNTU GURAJADA, VIZIANAGARAM 
Approved by AICTE, Accredited by NBA, Accredited by NAAC with ‘A +’grade 
2024-2025 
RAGHU INSTITUTE OF TECHNOLOGY 
(AUTONOMOUS) 
Affiliated to JNTU GURAJADA, VIZIANAGARAM 
 
Approved by AICTE, Accredited by NBA, Accredited by NAAC with ‘A+’ grade 
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING 
CERTIFICATE 
 
This is to certify that this project entitled “Full Stack Java” done by “PODURU CHAITANYA SAI (213J1A05E0)” is a student of  B.Tech in the Department of Computer Science and Engineering, Raghu Institute of Technology  during the period 2021-2025, in partial fulfillment for the award of the Degree of Bachelor of Technology in Computer Science and Engineering to the Jawaharlal Nehru Technological University, Gurajada Vizianagaram is a record of bonafide work carried out under my guidance and supervision. The results embodied in this internship report have not been submitted to any other University or Institute for the award of any Degree. 
 
 
 
 
 
 
Internal Guide 
Head of the Department 
Dr. S. Om Prakash, 
Dr.R. Sivaranjani, 
Dept of CSE, 
Dept of CSE, 
Raghu Engineering College 
Raghu Engineering College 
Dakamarri (V), 
Dakamarri (V), 
Visakhapatnam. 
Visakhapatnam. 

 
 	 
 
 
EXTERNAL EXAMINER 
 
 
 
 
 
 
 
 
 
 
 
 
 
DISSERTATION APPROVAL SHEET 
This is to certify that the dissertation titled 
 
FULL STACK JAVA 
BY 
                                                              PODURU CHAITANYA SAI 
 (213J1A05E0) 
 
Is approved for the degree of Bachelor of Technology 
 
 
 
 
 
 

                                                         Dr. S Om Prakash 
                                                    PROJECT  GUIDE (Associate professor) 
 
 
 
 

Internal Examiner 
 
 
 
 
 
 

External Examiner 
 
 
 
 
 
 

Dr. R. SIVARANJANI  HOD(Professor) 
 
 
Date: 
DECLARATION 
 
This is to certify that this internship titled “Full Stack Java” is bonafied work done by  me, impartial fulfillment of the requirements for the award of the degree B.Tech and submitted to the Department of Computer Science and Engineering, Raghu Institue of Technology, Dakamarri. 
I also declare that this internship is a result of my own effort and that has not been copied from anyone and I have taken only citations from the sources which are mentioned in the references. 
This work was not submitted earlier at any other University or Institute for the reward of any degree. 
 
 
Date: 
Place: 
 
 
             PODURU 
CHAITANYA SAI   
           (213J1A05E0) 
 



























CERTIFICATE 
 
 



































ACKNOWLEDGEMENT 
 
 
I express sincere gratitude to my esteemed Institute “Raghu Institute of Technology”, which has provided us an opportunity to fulfill the most cherished desire to reach my goal. 
 
I take this opportunity with great pleasure to put on record our ineffable personal indebtedness to Mr. Raghu Kalidindi, Chairman of Raghu Educational Institutes for providing necessary departmental facilities. 
 
I would like to thank the Principal Dr.V. Satyanarayana of “Raghu Engineering College”, for providing the requisite facilities to carry out projects on campus. Your expertise in the subject matter and dedication towards our project have been a source of inspiration for all of us.  
I sincerely express our deep sense of gratitude to Dr.R. Sivaranjani, Professor, Head of Department in Department of Computer Science and Engineering, Raghu Engineering College, for her perspicacity, wisdom and sagacity coupled with compassion and patience. It is my great pleasure to submit this work under her wing. I thank for guiding us for the successful completion of this project work. 
 
I would like to thank Dr. S. Om Prakash, Asst. Professor for providing the technical guidance to carry out module assigned. Your expertise in the subject matter and dedication towards our project have been a source of inspiration for all of us. 
I would like to thank Dr. Srikanth Muppalla, SkillDzire for providing the technical guidance to carry out module assigned. Your expertise in the subject matter and dedication towards our project have been a source of inspiration for all of us 
 
I extend my deep hearted thanks to all faculty members of the Computer Science department for their value-based imparting of theory and practical subjects, which were used in the project. 
 
   I thank the non-teaching staff of the Department of Computer Science and Engineering,             Raghu Institute of Technology, for their inexpressible support. 
 
 
            Regards 
                                                                                                                      PODURU CHAITANYA SAI 
       (213J1A05E0)               
TABLE OF CONTENTS 
 
 
	S.NO 	CHAPTER 	PAGE NUMBER 
Introduction to Java 	1 
Front end development 	6 
RDBMS(SQL) 	13 
JDBC 	17 
JSP&Servlet 	20 
Spring Framework 	22 
Project Annexure 	24 
























CHAPTER 1 
INTRODUCTION TO JAVA 
 
OUTCOMES OF LEARNING :- 
What is Java? 
Java, created by Sun Microsystems in 1995 and now owned by Oracle, is an object-oriented language known for its platform independence through the Java Virtual Machine (JVM). Its "write once, run anywhere" feature makes it ideal for building crossplatform applications. 
Features of Java 
Platform Independence: Java's "write once, run anywhere" ensures code runs on any platform with a JVM. 
Object-Oriented: Focuses on objects and classes, promoting modular and reusable code. 
Easy to Learn: Familiar to developers with C/C++ experience, making it easier to learn 
High Security: Provides strong memory management and built-in security features for applications. 
 
Setting Up the Java Environment 
Installing the Java Development Kit (JDK) 
The JDK includes the JVM, compiler (javac), and other tools necessary for Java development. It can be downloaded from Oracle’sofficial website. 
Data Types 
Java is statically typed, meaning variable types are declared explicitly. 
Primitive Data Types: 
byte, short, int, long(integer types) o float, double(floating-point types) 
char(single character) o 	boolean (true/false) 
Non-Primitive Data Types: 
Strings, Arrays o 	Classes o 	Interfaces 







1 
Operators 
 
Operators are used to perform various operations on variables and values in Java. 
Arithmetic Operators: Perform basic mathematical operations like addition (+), subtraction (-), multiplication (*), division (/), and modulus (%). 
Logical Operators: Used to perform logical operations, such as AND (&&), OR (||), and NOT (!), Typically in control flow statements. 
Assignment Operators: Assign values to variables, including =, as well as compound operators like +=, -=, *=, etc. 
Increment/Decrement Operators: Increase or decrease the value of a variable by 1 using ++ and --. 
Relational Operators: Compare values to determine the relationship between them, such as equal to (==), not equal to (!=), greater than (>), less than (<), and others like >=, <=. 
Control Flow Statements 
Control the execution flow of programs. 
• 	Conditional Statements: o 	if, else if, else syntax:if(condition){//statements} 
else if(condition){//statements} 
else {//statements} 
	o 	switch statements 
Loops 
Loops are used to repeatedly execute a block of code as long as a specified condition is true. 
for loop: Syntax: for(initialization; condition; increment/decrement) { //statements } 
It runs a block of code multiple times with control over the iteration process (initialization, condition, update). 
do-while loop: Executes the code block once before checking the condition. Syntax:do { //statements } while (condition); 
Enhanced for loop (for-each): Simplifies iteration over collections or arrays. Syntax:for(type element : collection) { //statements } 
while loop: Executes the code block as long as the condition is true. Syntax:while (condition) { //statements } 
 
 
 
 
 
 


2 
Object-Oriented Programming (OOP) in Java 
Classes and Objects 
Classes are blueprints for objects. Objects are instances of classes. 
public class Person { String firstName; int yearsOld; void introduce() { 
System.out.println("Hello, my name is " + firstName); } } public class Main { 
public static void main(String[] args) { Person person = new Person(); person.firstName = "John"; person.yearsOld = 25; person.introduce(); 
} 
} 
Constructors: 
Special methods in a class used to initialize objects when they are created. 
Default Constructor: A constructor with no parameters, used to provide default values to object attributes. 
Parameterized Constructor: Takes arguments to initialize objects with specific values. 
Inheritance: 
A mechanism where a new class (subclass) is derived from an existing class (superclass), allowing the subclass to inherit attributes and methods, thereby promoting code reuse and extensibility. 
Polymorphism: 
The ability of a single method or object to behave in multiple ways, achieved mainly through method overloading and method overriding. 
Method Overloading: Defining multiple methods with the same name but different parameter lists (by type, number, or order of parameters) within the same class. 
Method Overriding:Same function name with different parameters,number of parameters or return types. 
  







3 
 
Encapsulation 
Bundling data (variables) and methods that operate on the data into a single unit (class), and restricting access to some components. 
Abstraction 
Hiding complex implementation details and showing only the necessary features of an object. 
Abstract Classes: Cannot be instantiated and may contain abstract methods. 
Interfaces: Define a contract with abstract methods that implementing classes must override. 
Variable Scope 
Variables have different scopes based on where they are declared: 
Local Variables: Inside methods. 
Instance Variables: Inside classes but outside methods. 
Class Variables (Static): Shared among all instances. 
 
 
Arrays and Collections 
Arrays 6.3 Introduction to Collections Framework 
Java provides a robust Collections Framework to handle groups of objects. 
List: Ordered collection (e.g., ArrayList, LinkedList) 
Set: Unordered collection without duplicates (e.g., HashSet) 
Map: Key-value pairs (e.g., HashMap) 
Queue: Ordered collection for processing (e.g., LinkedList) import java.util.ArrayList; ArrayList<String> cities = new ArrayList<>(); cities.add("New York"); cities.add("London"); 
for (String city : cities) 
{ 
System.out.println(city); 
 
} 
 









4 
Exception Handling 
Understanding Exceptions 
Exceptions are events that disrupt the normal flow of a program. They can be handled to maintain program stability. Try-Catch Block 
Handle exceptions using try and catch. 
Finally Block 
Executes code regardless of whether an exception occurred. 
try { 
// Code that may throw exception } catch (Exception e) { 
// Handle exception } finally { 
// Cleanup code 
} 
Throw and Throws 
throw: Used to explicitly throw an exception. 
throws: Declares that a method might throw exceptions. 
 
Multithreading in Java 
Multithreading allows a CPU to run multiple threads at the same time, improving the efficiency of programs by performing tasks concurrently. A thread represents an independent unit of execution within a program. Java simplifies multithreading with built-in support, enabling developers to create, control, and manage threads seamlessly for better performance in complex applications. 
Creating Threads in Java 
 
There are two main ways to create threads in Java: 
 
a. Extending the Thread Class 	b. Implementing the Runnable Interface 
 



5 
CHAPTER 2 
Front End Development 
 
OUTCOMES OF LEARNING HTML:- 
 
HTML (HyperText Markup Language) is the core language used to build and structure web content. It allows developers to create web pages by organizing elements like text, images, links, and forms. This offers key concepts of HTML, serving as a beginner's guide to web development fundamentals.HTML is a markup language that structures content for the web. Instead of using logic like programming languages,HTML relies on tags to define various elements, which control how text, images, and other media are displayed in a browser. It's essential for building the framework of web pages. 
Key Features of HTML 
 
Structure: Organizes content into headings, paragraphs, lists, and more. 
 
Semantics: Provides meaning to web content, enhancing accessibility and SEO. 
 
Integration: Works seamlessly with CSS (Cascading Style Sheets) and JavaScript to create styled and interactive web pages. 
 
Basic Structure of an HTML Document 
 
Every HTML document follows a standardized structure, ensuring consistency and proper rendering across browsers. 
 
<!DOCTYPE html> 
 
<html lang="en"> 
 
<head> 
 
  



6 
<meta charset="UTF-8"> 
<title>Page Title</title> 
 
</head> 
 
<body> 
 
<!-- Content goes here --> 
 
</body> 
 
</html> 
 
Explanation of Components 
 
<!DOCTYPE html>: Defines the document type and HTML version being used. 
 
<html>: The root element that contains all other HTML elements in the document. 
 
<head>: Includes metadata, such as the page's title, character encoding, and links to stylesheets. 
 
<meta charset="UTF-8">: Declares the character encoding for proper display of text content. 
 
<title>: Specifies the title of the webpage, shown on the browser's tab. 
 
<body>: Contains the content visible to the user, like text, images, and other web elements.Common HTML Elements and Tags 
 
HTML elements are the building blocks of web pages, defined by tags. Tags typically come in pairs: an opening tag 
 
<tag> and a closing tag </tag>. 
 
 
  





7 
Essential HTML Tags 
 
Headings: Define different levels of headings using <h1> to <h6>, where <h1> is the largest and most important, and <h6> is the smallest.  
Paragraphs: Wrap blocks of text inside <p> tags to create paragraphs. 
 
Links: Use the <a> tag to create hyperlinks, with the href attribute specifying the destination URL. Example: <a href="https://example.com">Click Here</a> 
 
Images: Embed images using the <img> tag. The src attribute specifies the image file, and the alt attribute provides alternative text for accessibility. Example: <img src="image.jpg" alt="Description of the image"> 
 
Lists: 
 
Unordered Lists: Use <ul> with <li> tags for bullet point lists. 
 
Ordered Lists: Use <ol> with <li> tags for numbered lists. 
 
Attributes in HTML 
 
Attributes provide additional information about HTML elements. They are included within the opening tag and follow a key-value pair format. 
Common Attributes 
 
id and class: Used for identifying and styling elements. 
 
href: Specifies the URL in anchor tags.  
src and alt: Define the source and alternative text for images. 
 
style: Inline CSS styling for individual elements. 
 
 
Forms and User Input 
 
Forms are essential for collecting user input, functionalities like registrations, searches, feedback submissions. 
 
8 
Basic Form Structure 
 
<form action="/process" method="post"> 
 
<label for="username">Username:</label> 
 
<input type="text" id="username" name="username" required> 
 
<label for="useremail">Email Address:</label> 
 
<input type="email" id="useremail" name="useremail"> 
 
<input type="submit" value="Send"> 
 
</form> 
 
Key Form Elements 
 
<form>: Encapsulates the form elements. The action attribute specifies the submission URL, and method defines the HTTP method (GET or POST). • <label>: Associates a text label with a form control using the for attribute. 
 
<input>: Various types for user input, such as text, email, password, submit, etc. 
 
<textarea>: For multi-line text input.  
<select> and <option>: Create dropdown lists. 
 
 
 
 
 
 



9 
OUTCOMES OF LEARNING CSS:- 
What is CSS? 
 
CSS (Cascading Style Sheets) is a stylesheet language that manages the visual presentation of web pages, including aspects like colors, layouts, fonts, and spacing. By separating design from content (HTML), CSS promotes a cleaner and more organized structure, making it easier to maintain and update the appearance of a website. 
CSS Syntax 
 
CSS is composed of two parts: 
 
Selector: Specifies which HTML elements to style. 
 
Declaration Block: Contains one or more declarations enclosed in curly braces {}. Each declaration has a property and a value separated by a colon. Example: 
p { color: red; font-size: 12px; 
} 
 
Selectors 
 
Selectors target specific HTML elements for styling. Common types include: 
 
	• 	Element Selector: Targets all elements of a type. E.g., p {} styles all <p> tags. 
 
 
 
10 
Class Selector: Targets elements with a specific class. Classes are reusable. E.g., .myClass {} targets elements with class="myClass". • 	ID Selector: Targets a single element with a specific ID. IDs are unique. E.g., #myId {}. 
 
Attribute Selector: Targets elements based on attributes. E.g., input[type="text"] {}. 
 
Colors 
 
CSS supports various ways to define colors: 
 
Named Colors: Predefined names like green, blue.  
Hexadecimal: E.g., #00ff00 for green.  
RGB/RGBA: E.g., rgb(0, 0, 255) for blue, and rgba(0, 0, 255, 0.5) for semi-transparent blue. 
 
Fonts and Text 
 
CSS controls the appearance of text: 
 
font-family: Defines the font. E.g., font-family: 'Times New Roman', serif; 
 
font-size: Sets the size. E.g., font-size: 12px;. 
 
font-weight: Controls boldness. E.g., font-weight: italian;. 
 
text-align: Aligns text. E.g., text-align: left,right;. 
 
text-decoration: Adds underlines, overlines, or strikethrough. E.g., text-decoration: underline;. 
 
Box Model 
The CSS box model defines how elements are structured on a webpage, consisting of several layers around the content. 
 
Content: The innermost part that contains the actual content like text or images. 
 
Padding: The edge surrounding the padding, creating a visible boundary around the element. 


11 
Border: The edge surrounding the padding, creating a visible boundary around the element. 
 
Margin: The outermost layer, defining the space between the element's border and neighboring elements, providing external spacing.div { margin: 30px; padding: 15px; border: 2px solid black; } 
 
Display 
 
The display property in CSS defines how an element is visually rendered in relation to other elements on the page. 
 
block: The element occupies the full width available, stacking on top of other elements, often used for structural elements like <div> and <header>. 
inline: The element only takes up as much width as its content needs and does not force line breaks, commonly used for text elements like <span> and <a>. 
inline-block: Behaves like an inline element but allows setting custom width and height, useful for items like buttons or images. 
none: The element is hidden from view and removed from the document layout, meaning it doesn't occupy any space. 
sticky: The element acts relatively positioned until a certain scroll point, at which it becomes fixed in position, useful for headers or navigation menus. External, Internal, and Inline Styles 
External Stylesheet: Linked via a .css file. Preferred for maintainability. 
 
Internal Stylesheet: Embedded within the <style> tag in the HTML document. 
 
Inline Styles: Applied directly to the HTML element using the style attribute. 
 
By mastering these CSS basics, you’ll be well-equipped to design responsive and visually appealing web pages. 
 







12 
 	CHAPTER 3 
 
 	RDBMS(SQL) 
 
OUTCOMES OF LEARNING:- 
What is SQL? 
 
SQL (Structured Query Language) is a standardized language for interacting with relational databases. It enables users to efficiently create, read, update, and delete (CRUD) data, providing powerful tools for managing and querying database information. 
 
Database Fundamentals 
 
Database: An organized collection of data stored electronically. 
 
Table: A collection within a database, consisting of rows and columns. 
 
Row (Record): A single entry in a table, representing a unique data item. 
 
Column (Field): A specific attribute of data within a table, defined by a data type. 
 
Data Types 
 
SQL supports various data types to define the nature of data in each column: 
 
INTEGER: Whole numbers. 
 
VARCHAR: Variable-length character strings.  
DATE: Date values.  
DECIMAL: Fixed-point numbers for precise calculations. 
 
BOOLEAN: True or false values. 
 
13 
Basic SQL Commands 
SELECT: Retrieves data from one or more tables.
 
1)SELECT column1, column2 FROM table_name; 2)SELECT * FROM table_name; 
 
INSERT: Adds new records to a table. 
 
INSERT INTO table_name (columnA, columnB) VALUES (valueA, valueB); 
 
UPDATE: Modifies existing records. 
 
UPDATE table_name SET columnA = valueA WHERE conditionA; 
 
DELETE: Removes records from a table. 
 
DELETE FROM table_name WHERE condition; 
 
The WHERE Clause 
 
Filters records based on specified conditions. 
SELECT * FROM student WHERE department = 
'Cse'; 
JOIN Operations 
 
Combines rows from two or more tables based on related columns. 
 
INNER JOIN: Returns records with matching values in both tables. 
 
LEFT JOIN: Returns all records from the left table and matched records from the right. 
 
RIGHT JOIN: Returns all records from the right table and matched records from the left. 
 
FULL JOIN: Returns all records when there is a match in either table. 
 
14 
Primary and Foreign Keys 
Primary Key: A unique identifier for each record in a table. 
 
CREATE TABLE 
employees ( id INT 
PRIMARY KEY, 
name VARCHAR(100) 
 
);  
Foreign Key: A field that links to the primary key of another table, 
 establishing a relationship. CREATE TABLE salaries ( employee_id INT, salary 
DECIMAL, 
FOREIGN KEY (employee_id) REFERENCES employees(id) 
 
); 
 
 
Constraints 
 
Rules enforced on data columns to ensure data integrity. 
 
NOT NULL: Ensures a column cannot have NULL values.  
UNIQUE: Ensures all values in a column are unique.  
CHECK: Ensures values meet a specific condition.  
DEFAULT: Sets a default value for a column. 
 
 
15 
Aggregation Functions 
Perform calculations on multiple rows of a table's column.
 
COUNT(): Returns the number of rows.  
SUM(): Adds up values.  
AVG(): Calculates the average.  
MAX() / MIN(): Finds the highest or lowest value. 
 
SELECT COUNT(*), AVG(salary) FROM employees; 
 
 
Normalization Organizes database structure to reduce data redundancy and improve data integrity by dividing large tables into smaller, related tables. 
The types of normalization include First Normal Form (1NF), Second Normal Form (2NF), Third Normal Form (3NF), Boyce-Codd Normal Form (BCNF), Fourth Normal Form (4NF), Fifth Normal Form (5NF). 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16 
 	CHAPTER 4 
 
 	JDBC 
OUTCOMES OF LEARNING:- 
What is JDBC? 
 
JDBC (Java Database Connectivity) is an API in Java that facilitates communication between Java applications and relational databases. It offers a standardized set of interfaces for executing queries and performing data updates, simplifying the integration of Java applications with different databases, including MySQL, PostgreSQL, Oracle, and SQL Server. 
 
JDBC Architecture 
 
JDBC architecture consists of four main components: 
 
JDBC API: Provides classes and interfaces for database operations. 
 
JDBC Driver Manager: Manages a list of database drivers and establishes connections. 
 
JDBC Drivers: Implement the API for specific databases (e.g., MySQL JDBC Driver). 
 
Database: The backend RDBMS where data is stored. 
 
JDBC Drivers 
 
JDBC drivers are categorized into four types: 
 
Type 1: JDBC-ODBC Bridge (deprecated). 
 
Type 2: Native-API/partly Java driver. 
 
Type 3: Network Protocol driver. 
 
Type 4: Pure Java driver (commonly used for its portability). 
 
 
17 
Establishing a Connection 
 
To interact with a database, a connection must be established using DriverManager: String url = "jdbc:mysql://localhost:3306/mydatabase"; 
String user = "root"; 
 
String password = "password"; 
 
Connection conn = DriverManager.getConnection(url, user, password); 
 
 
Key Interfaces and Classes 
 
Connection: Represents a connection to the database.  
Statement: Executes static SQL statements.  
PreparedStatement: Executes precompiled SQL statements with parameters. 
 
CallableStatement: Executes stored procedures.  
ResultSet: Represents the result of a query. 
 
 
Executing SQL Statements 
 
	• 	SELECT Query: 
 
Statement stmt = conn.createStatement(); 
 
ResultSet rs = stmt.executeQuery("SELECT * FROM employees"); 
while (rs.next()) { 
System.out.println(rs.getString("name")); } 
 
18 
INSERT, UPDATE, DELETE: 
 
String sqlQuery = "INSERT INTO customers (fullName, sector) VALUES (?, ?)"; PreparedStatement preparedStatement = connection.prepareStatement(sqlQuery); preparedStatement.setString(1, "Jane Smith"); preparedStatement.setString(2, "Marketing"); 
 int affectedRows = preparedStatement.executeUpdate(); 
 
PreparedStatement and CallableStatement 
 
PreparedStatement: Enhances performance and security by precompiling SQL and preventing SQL injection. 
 
CallableStatement: Used to execute stored procedures in the database. 
 
By mastering these JDBC basics, you can effectively connect Java applications to databases, perform essential CRUD operations, and manage data efficiently within your projects. 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19 
CHAPTER 5 
JSP & SERVLETS 
  
OUTCOMES OF LEARNING :- What is JSP? 
JSP (JavaServer Pages) is a server-side technology that enables the development of dynamic, platform-independent web applications. By allowing Java code to be embedded within HTML, JSP promotes a clear separation between presentation and business logic, making it easier to manage and maintain web content. 
JSP Architecture 
JSP operates on the Model-View-Controller (MVC) architecture: 
Client: Sends a request via a web browser. 
JSP Engine: Processes the JSP page, converting it into a servlet. 
Servlet: Executes the embedded Java code and interacts with the server. 
Database: Stores and retrieves data as needed. 
Response: The servlet sends the processed HTML back to the client. 
 
JSP Syntax 
JSP files use the .jsp extension and combine HTML with special JSP tags to embed Java code. Basic structure: 
<%@ directive %> 
<html> 
<head><title>JSP Example</title></head> 
<body> 
<% 
// Java code here out.println("Hello, Intern"); 
%> 
</body> 
</html> 
20 
SERVLET 
 
 
OUTCOMES OF LEARNING:- 
 
What is a Servlet? 
 
A Servlet is a Java class that enhances the functionality of servers hosting applications accessed through request- response models, primarily over HTTP. Servlets are a core component of Java EE, enabling the creation of dynamic web applications by processing client requests and generating responses. 
Servlet Architecture 
 
Servlets operate within a servlet container, such as Apache Tomcat, which oversees their lifecycle and provides necessary networking functions. They are commonly structured using the Model-View-Controller (MVC) design pattern, with Servlets acting as controllers that process requests and determine how to respond to clients. 
Servlet Lifecycle 
Understanding the lifecycle is crucial for effective servlet management: 
Loading and Instantiation: The servlet container loads the servlet class and instantiates it, managing its lifecycle from initialization to destruction. 
Initialization (init): The init() method is called once to initialize the servlet, setting it up for handling client requests throughout its lifecycle. 
Request Handling (service): The service() method handles incoming client requests and delegates them to specific methods like doGet() or doPost(), depending on the HTTP method used. 
Destruction (destroy): The destroy() method is invoked to release resources and perform cleanup operations before the servlet is taken out of service. 
 
 
 
 
 
 
 
 
 
 
21 
CHAPTER 6 
Spring Framework 
 
OUTCOMES OF LEARNING:- 
 
What is Spring? 
Spring is a powerful, open-source framework designed for developing enterprise-level Java applications. It offers a strong infrastructure that supports best practices like dependency injection and aspect-oriented programming, enhancing modularity and facilitating easier testing of Java applications. 
Core Features of Spring 
 
Inversion of Control (IoC) / Dependency Injection (DI): A core principle of Spring, Inversion of Control (IoC) enables the framework to handle object creation and dependency management, fostering loose coupling and greater flexibility in application design. 
Aspect-Oriented Programming (AOP): It facilitates the separation of cross-cutting concerns, like logging and security, from the main business logic, improving code maintainability and clarity. 
Spring Modules 
 
Spring's modular architecture enables developers to utilize only the components they require: 
 
Spring Core: Provides essential functionalities like Inversion of Control (IoC) and Dependency Injection (DI) to effectively manage application components. 
Spring MVC: Offers tools for building web applications that adhere to the Model-View-Controller (MVC) design pattern. 
Spring Data: Simplifies data access by supporting multiple databases and various data access technologies. 
Spring Security: Provides robust authentication and authorization features to secure applications effectively. 
Spring Boot: Streamlines application development with features such as auto-configuration and embedded server support, enabling quicker setup and deployment. 
 
 
22 
Beans and Application Context 
Beans: Objects that are created, assembled, and managed by Spring's IoC container. They can be defined using annotations (such as @Component, @Service, and @Repository) or via XML configuration. 
 
 
Application Context: The main interface for providing configuration information to the application, managing the lifecycle of beans and their dependencies. 
 
 
Copy code 
@Bean 
public UserService userService() 
{ return new 
UserServiceImpl(); 
} 
 
 
In this example, a UserService bean is defined, returning an instance of UserServiceImpl. 
 
 
Dependency Injection Types 
 
Constructor Injection: Dependencies are supplied through the class constructor, encouraging immutability. 
 
Setter Injection: Dependencies are assigned via setter methods, allowing optional dependencies. 
 
Spring MVC Overview 
 
Spring MVC is a powerful framework for building web applications: 
 
DispatcherServlet: The core component responsible for routing requests to the appropriate handlers. 
 
Controllers: Process incoming requests and generate responses. 
 
Views: Render the response, often utilizing technologies such as Thymeleaf or JSP. 
 
 
23 
PROJECT 
Online Shopping System 
The project aims to provide a comprehensive solution for online shopping, meeting the needs of both customers and vendors while promoting a secure and efficient e-commerce environment. 
 
Here’s a concise overview: 
 
Abstract: 
The Online Shopping System is a comprehensive web-based application designed to provide seamless solutions for both vendors and customers. The primary objective is to create an efficient platform for managing customer orders, inventory, and secure transactions. By utilizing Java, Spring, Spring Boot, and MySQL, the system aims to streamline the shopping process, enhance user experience, and offer a user-friendly interface for browsing products, managing carts, and completing purchases. The application includes backend APIs that facilitate various functionalities, ensuring a robust and scalable solution for online shopping. 
 
Implementation Details: 
 
The implementation of the Online Shopping System follows a modular architecture, leveraging the Spring framework dependency management and aspect-oriented programming. 
 
The core components include: 
 
Backend Development: Built using Spring Boot to create RESTful APIs for user registration, login, product management, and order processing. 
 
Database Management: MySQL is used to manage user data, product information, customer orders, and 
addresses. 
API Endpoints: Designed for user registration, login, product addition, cart management, and order processing. 
Each endpoint is secured and validated to ensure data integrity and user privacy. 
 
Modules: 
User Module: Handles user registration, authentication, and profile management. 
Product Module: Manages product listings, categories, and inventory. 
Cart Module: Manages the user's shopping cart and associated products. 
Order Module: Handles order creation, history, and status tracking. 
Address Module: Manages customer addresses for shipping and billing. 
 
 
 
24 
Conclusion: 
The Online Shopping System effectively meets the needs of modern e-commerce by providing a scalable, secure, and user-friendly platform. By utilizing Spring's powerful features, the application is designed for high performance and easy maintenance. The integration of robust backend APIs ensures that users have a seamless shopping experience, from product selection to order completion. Future enhancements can include advanced analytics, 
personalized recommendations, and improved security measures. 
 
System Configuration:- Hardware Configuration:- 
Processor: Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz 
Speed: 1.1 GHz 
RAM: 16 GB 
	• 	Hard Disk: 20 GB 
Keyboard: Standard Windows Keyboard 
Mouse: Two or Three Button Mouse 
Monitor: SVGA Software Requirements: 
 
Front-End Frameworks: Angular (or another chosen framework) 
Back-End Services: Java (Spring Boot) 
	• 	Database: MySQL 
	• 	Security: Secure authentication and encryption protocols 
 
 

 
25 
 
ANNEXURE 
 
Below are some code snippets and results of the project online shopping system done as a part of theory 
 
User Registration 
User Login 
Browse Products 
Add Products to Cart 
View Cart 
Place an Order 
Manage Address 
Order History 
 
CONNECTING WITH DATABASE 
 Request used for each endpoint: 
Registration(adding user): 
{ 
"UserId":101, 
"name": "Sai", 
"mobile":"7896158490", "password": "sai@123", 
“role”: “Customer” 
} 
 Login : 
{ 
"mobileNo":"7896158490", 
"password": "sai@123" 
} 
 Adding Product: 
{ 
"productName":"SamsungGalaxy", 
"price": 1000, 
"quantity":1, 
"manufacturer":"Samsung", 
"category":"MOBILES" 
} 
 Adding Address:
{  
26 
"streetNo":"101", 
"buildingName":"SuryaEnclave", 
"city":"hyderabad", 
"country":"india", 
"state":"Telangana", 
"pincode":500010 
} 
 Adding Customer: 
{ 
"firstName":"Sai", 
"lastName":"Surya", 
"mobileNumber":"7896158490", 
"email":"sai@gmail.com", 
"addressList":[{ 
"streetNo":"101", 
"buildingName":"SuryaEnclave", 
"city":"hyderabad", 
"country":"india", 
"state":"Telangana", 
"pincode":500010 
}] 
} 
 
DBScripts: 
Create database project; use project; create table address (address_id integer not null, building_name varchar(255) not null, city varchar(255) not null, country varchar(255) not null, pincode varchar(255), state varchar(255) not null, street_no varchar(255) not null, primary key (address_id)) engine=InnoDB 
create table cart (cart_item_id integer not null, cart_item_product_id integer, customerlist_customer_id integer, primary key (cart_item_id)) engine=InnoDB 
create table current_user_session (id integer not null, user_id integer, time datetime(6), unique_id varchar(255), primary key (id)) engine=InnoDB 
create table customer (customer_id integer not null, email varchar(255), first_name varchar(255) not null, last_ name varchar(255) not null, mobile_number varchar(255) not null, primary key (customer_id)) engine=InnoDB create table customer_addresslist (customer_customer_id integer not null, addresslist_address_id integer not null) engine=InnoDB 
create table hibernate_sequence (next_val bigint) engine=InnoDB insert into hibernate_sequence values ( 1 ) 
create table my_order (orderid integer not null, localdtetime datetime(6), orderstatus varchar(255), address_ address_id integer, customer_customer_id integer, primary key (orderid)) engine=InnoDB 
create table my_order_productlist (my_order_orderid integer not null, productlist_product_id integer not null) engine=InnoDB 
27 
create table products (product_id integer not null, category varchar(255), color varchar(255), dimension 
varchar(255), manufacturer varchar(255) not null, price double precision not null, product_name varchar(255) not 
null, quantity integer, specification varchar(255), primary key (product_id)) engine=InnoDB 
create table user (user_id integer not null, mobile varchar(255) not null, name varchar(255) not null, password varchar(255) not null, primary key (user_id)) engine=InnoDB 
alter table current_user_session drop index UK_jhte8iaovevdj69c971ca2wm1 
alter table current_user_session add constraint UK_jhte8iaovevdj69c971ca2wm1 unique (user_id) alter table customer_addresslist drop index UK_mt716rawdy7i1l9g1dxfm5lei 
alter table customer_addresslist add constraint UK_mt716rawdy7i1l9g1dxfm5lei unique (addresslist_address_ id) 
alter table my_order_productlist drop index UK_c9itc02enbmxj3na73qdw41s9 
alter table my_order_productlist add constraint UK_c9itc02enbmxj3na73qdw41s9 unique (productlist_product 
_id) 
alter table cart add constraint FKihmlrhtwvqu0tscap75v2cjg6 foreign key (cart_item_product_id) references products (product_id) 
alter table cart add constraint FKf9l7w5riuboahnilmumqd0pq foreign key (customerlist_customer_id) references customer (customer_id) 
alter table customer_addresslist add constraint FK4vplq9fbs3d6ppj6od8o6rr7t foreign key (addresslist_address 
_id) references address (address_id) 
alter table customer_addresslist add constraint FKpjp29ubg21t0y32s96srwfkva foreign key (customer_customer 
_id) references customer (customer_id) alter table my_order add constraint FKs52kryjqp4quf5crtm1i7pmgt foreign key (address_address_id) references 
address (address_id) 
alter table my_order add constraint FKdly9avjdrmbmk71r9gwngxssh foreign key (customer_customer_id) 
references customer (customer_id) 
alter table my_order_productlist add constraint FK9bj7w2f1s7us9e1ddsx8g547v foreign key (productlist_product 
_id) references products (product_id) alter table my_order_productlist add constraint FKtqxtuftr1mf6shtuf4vrs6o9s foreign key (my_order_orderid) 
references my_order (orderid) 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28 

"""