Aditya
Aditya
UTTAR PRADESH
Lab File
Web Technology
Name-Aditya Raj
Admission no.-22SCSE1010456
Section-43
1|Page
Index
1
Experiment No. 1
Simple HTML Page
Outputs
1
Experiment No. 2
HTML CV Page
Outputs
2
Experiment No. 3
HTML Frames
Aim/Objective: To implement frames in HTML with one frame for hyperlinks and
another for content.
Theory: HTML frames (deprecated in HTML5) split the browser window using <frameset>.
Modern alternatives include <iframe> or CSS.
Observation: Two frames display: one with links to Indian websites, another showing
their content.
Code:
1 <! DOCTYPE html>
2 <html>
3 <head>
4 <title>Frames Example</title>
5 </head>
6 <frameset cols="30%,70%">
7 <frame src="links.html" name="links">
8 <frame src="content.html" name="content">
9 </ frameset>
10 </html>
11
Outputs
3
Experiment No. 4
CSS Implementation
Aim/Objective: To implement CSS in HTML using inline, internal, and external meth-
ods.
Theory: CSS styles HTML elements via inline (within tags), internal (<style>), or
external (.css file) methods.
Observation: The page displays styled text inspired by Indian culture using all CSS
methods.
Code:
1 <! DOCTYPE html>
2 <html lang="en">
3 <head>
4 <meta charset ="UTF-8">
5 <title>CSS Implementation</title>
6 <link rel=" stylesheet" href="styles.css">
7 <style>
8 p.internal { color: saffron; }
9 </style>
10 </head>
11 <body>
12 <h1 style="color: green;">Inline CSS: Indian Flag</h1 >
13 <p class=" internal">Internal CSS: Saffron Color</p>
14 <p class=" external">External CSS: Blue Chakra</p>
15 </body>
16 </html>
17
Outputs
4
Experiment No. 5
HTML Form with JavaScript Validation
Aim/Objective: To design an HTML form for student records with JavaScript valida-
tion.
Theory: HTML forms collect input, and JavaScript validates fields like name and roll
number.
Observation: The form validates inputs for an Indian student and alerts on submission.
Code:
1 <! DOCTYPE html>
2 <html lang="en">
3 <head>
4 <meta charset ="UTF-8">
5 <title>Student Record Form</title>
6 <script>
7 function validateForm() {
8 let name = document.forms[" studentForm"]["name"]. value;
9 let roll = document.forms[" studentForm"]["roll"]. value;
10 if (name == "" || roll == "") {
11 alert("All fields must be filled out");
12 return false;
13 }
14 if (!/^[0 -9]{6}$/. test(roll))
15 { alert("Roll number must be 6 digits");
16 return false;
17 }
18 alert("Form submitted successfully!");
19 return true;
20 }
21 </script>
22 </head>
23 <body>
24 <form name=" studentForm" onsubmit="return validateForm()">
25 <label>Name:</label><input type="text" name="name"><br>
26 <label>Roll No:</label><input type="text" name="roll"><br>
27 <input type="submit" value="Submit">
28 </form>
29 </body>
30 </html>
Outputs
5
Experiment No. 6
Web Page with Bootstrap
3 <head>
4
8 <body>
9
10
11
12
13
Outputs
6
Experiment No. 7
AJAX Implementation
10
11
12
13
19
20
21
22
23
Outputs
7
Experiment…No.8
jQuery Implementation
Outputs
8
Experiment No. 9
2
<%@ page language="java" contentType="text/html; charset=UTF-8"
3
pageEncoding="UTF-8"%>
4
<!DOCTYPE html>
5
<html>
6
<head >
7
<title >JSP Dynamic Page </title >
8
</head >
9
<body>
10
<h1 >Dynamic JSP Page </h1 >
11
<p>Current Time (IST): <%= new java.util.Date() %></p>
</body>
</html>
Outputs
9
Experiment No. 10
4 <head>
5
7 <body>
8
10
11
12
13
14
15
16
17
18
19
20
21
22
Outputs
10
Experiment No. 11
Servlet/JSP Content Display
Outputs
11
Experiment No. 12
20
<!-- welcome.jsp -->
21
<%@ page language="java" contentType="text/html;
22
charset=UTF-8" pageEncoding="UTF-8"%>
23
<!DOCTYPE html>
24
<html>
25
<head >
26
<title >Welcome </title >
27
</head >
28
<body>
<%
29
String username = request. getParameter("
30
username"); String password = request.
31
getParameter(" password");
32
if (username != null && password != null &&
33
username.equals(" rahul") && password.equals("
34
india123 ")) {
35
session. setAttribute(" username", username);
36
out.println("<h1 >Welcome , " + username +
37
"!</h1 >");
Outputs
12
Experiment No. 13
Servlet/JSP Email Program
5 <head >
6
8 <body>
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
13
39
40
41
42
43
44
45
46
47
Outputs
14