Repository navigation
Expand file tree
/
Copy pathjavaAssignment.1.txt
More file actions
201 lines (118 loc) · 4.17 KB
/
Copy pathjavaAssignment.1.txt
File metadata and controls
201 lines (118 loc) · 4.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
Here’s a **clear, structured breakdown** of your Web Applications topic—optimized for fast learning and exam readiness:
---
# **1. Introduction to Web Applications**
A **web application** is software that runs on a web server and is accessed through a web browser over a network (usually the internet).
**Examples:** Gmail, online banking systems, e-commerce sites.
---
# **2. Web Applications & Their Advantages**
### **What is a Web Application?**
A program where users interact through a browser instead of installing software locally.
### **Advantages**
* **Cross-platform** → Works on any device with a browser
* **No installation required** → Reduces deployment friction
* **Centralized updates** → Changes reflect instantly for all users
* **Scalable** → Can handle many users
* **Accessible anywhere** → Requires only internet access
---
# **3. Architecture & Components of a Web Application**
### **Three-Tier Architecture**
1. **Presentation Layer (Frontend)**
* HTML, CSS, JavaScript
* User interface
2. **Application Layer (Backend)**
* Java (Servlets, JSP)
* Business logic processing
3. **Data Layer**
* Database (MySQL, Oracle)
* Data storage and retrieval
---
### **Key Components**
* Client (Browser)
* Web Server
* Application Server
* Database
---
# **4. HTTP Protocol & Its Methods**
### **What is HTTP?**
**HTTP (HyperText Transfer Protocol)** is the communication protocol between client and server.
### **Common HTTP Methods**
* **GET** → Retrieve data
* **POST** → Send data (e.g., forms)
* **PUT** → Update data
* **DELETE** → Remove data
* **HEAD** → Retrieve headers only
---
# **5. HTTP/2 Protocol**
### **What is HTTP/2?**
An improved version of HTTP designed for **performance and efficiency**.
### **Key Features**
* **Multiplexing** → Multiple requests in one connection
* **Header Compression** → Faster communication
* **Server Push** → Server sends resources before request
* **Binary Protocol** → More efficient than text-based HTTP/1.1
### **Methods Used**
Same as HTTP/1.1:
* GET, POST, PUT, DELETE, etc.
(Only performance improved, not method types)
---
# **6. Components Used in Developing Web Applications**
### **Frontend Components**
* HTML → Structure
* CSS → Styling
* JavaScript → Interactivity
### **Backend Components**
* Servlets
* JSP (Java Server Pages)
* Frameworks (Spring, etc.)
### **Database**
* MySQL, PostgreSQL, Oracle
### **Server**
* Apache Tomcat (Servlet container)
---
# **7. Advantages & Disadvantages of Servlets**
### **Advantages**
* High performance (faster than CGI)
* Platform independent (Java-based)
* Secure and robust
* Efficient memory usage
### **Disadvantages**
* Requires Java knowledge
* More code compared to JSP
* Not ideal for UI design
* Debugging can be complex
---
# **8. Sequence of Events (Request → Response)**
This is **VERY IMPORTANT for exams**:
1. User sends request (browser)
2. Request goes to Web Server
3. Web Server forwards to Servlet
4. Servlet processes request (business logic)
5. Servlet interacts with database (if needed)
6. Servlet generates response
7. Response sent back to browser
8. Browser displays result
---
# **9. Services Provided by a Web Container**
A **Web Container** (e.g., Apache Tomcat) manages Servlets.
### **Key Services**
* **Lifecycle Management**
* Loads, initializes, destroys Servlets
* **Request Handling**
* Routes requests to correct Servlet
* **Security**
* Authentication & authorization
* **Session Management**
* Tracks user sessions
* **Multithreading**
* Handles multiple requests efficiently
* **JSP Support**
* Converts JSP into Servlets
---
# **10. (Repeated) Advantages & Disadvantages of Servlets**
Same as point 7 — ensure you can **write it cleanly in exams**.
---
# **11. (Repeated) Request–Response Cycle**
Same as point 8 — memorize the **step-by-step flow**.
---
# **12. (Repeated) Web Container Services**
Same as point 9 — focus on **key responsibilities**.