0% found this document useful (0 votes)
18 views29 pages

IWT End Semester Assets

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)
18 views29 pages

IWT End Semester Assets

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/ 29

IWT End Semester Assets-

By Jasneet Singh Saini

Unit 1 –

1. Concept of WWW (World Wide Web):


• Explanation:
• The World Wide Web (WWW) is a system of interconnected documents and
resources linked by hyperlinks.
• Real-world example:
• Think of the WWW as a giant digital library where you can access different books
(websites) by following links.
2. HTTP Protocol: Request and Response:
• Explanation:
• HTTP (Hypertext Transfer Protocol) is the foundation of data communication on
the web. It involves clients (like browsers) making requests to servers, which
respond with data.
• Real-world example:
• When you type a website URL (e.g., www.example.com) in your browser, it
sends an HTTP request to the server, and the server responds by sending the
web page to be displayed.
3. Web Browser Architecture and Web Servers:
• Explanation:
• Web browsers (like Chrome, Firefox) are software that retrieves and displays
web pages. Web servers store and provide these pages upon request.
• Real-world example:
• Imagine a browser as a librarian (client) asking a server (library) for a specific
book (web page), and the server provides the book to be read.
4. Application Servers:
• Explanation:
• Application servers handle the business logic and database interactions of a web
application.
• Real-world example:
• In an online shopping website, the application server manages the shopping cart,
order processing, and inventory interactions.
5. Features of Web 2.0:
• Explanation:
• Web 2.0 refers to a more interactive and collaborative web, where users
contribute content (social media, wikis) rather than just consuming it.
• Real-world example:
• Social media platforms like Facebook and Twitter, where users create and share
content, exemplify the features of Web 2.0.
6. Internetworking with TCP/IP:
• Explanation:
• TCP/IP (Transmission Control Protocol/Internet Protocol) is the suite of
communication protocols that powers the Internet.
• Real-world example:
• When you send an email or browse a website, TCP/IP is at work, ensuring data is
transmitted reliably across the Internet.
7. Basics of DNS, SMTP, POP3:
• Explanation:
• DNS (Domain Name System) translates domain names to IP addresses. SMTP
(Simple Mail Transfer Protocol) and POP3 (Post Office Protocol 3) are protocols
for email.
• Real-world example:
• DNS is like a phonebook for the Internet, translating a domain name (like
www.example.com) to its corresponding IP address. SMTP is used for sending
emails, while POP3 is used for retrieving them.
Unit 2

1. Concepts of Effective Web Design:


• Explanation:
• Effective web design involves creating websites that are visually appealing, user-
friendly, and achieve their intended purpose.
• Real-world example:
• Consider a well-designed e-commerce site that has a clean layout, easy
navigation, and clear product images, making it easy for users to find and
purchase items.
2. Planning and Publishing a Website:
• Explanation:
• Planning involves defining the purpose, content, and structure of a website.
Publishing involves making the site accessible on the Internet.
• Real-world example:
• Before building a personal blog, plan the topics you'll cover. Publishing is the
step where you make your blog live and accessible to others.
3. Introduction to Web Architecture:
• Explanation:
• Web architecture refers to the structure and organization of web components,
including servers, databases, and client devices.
• Real-world example:
• Think of web architecture as the blueprint for a skyscraper, outlining how
different parts (floors, rooms) interact to create a functional whole.
4. HTML (Hypertext Markup Language):
• Explanation:
• HTML is the standard markup language for creating web pages. It includes
elements for text, images, tables, forms, etc.
• Real-world example:
• In a web page's HTML, the <img> tag is used to embed images, <table> for
tables, and <form> for interactive input forms.
5. Document Type Definition (DTD) and Document Object Model (DOM):
• Explanation:
• DTD defines the structure and legal elements of an HTML document. DOM
represents the document as a tree of objects that can be manipulated.
• Real-world example:
• DTD is like a rulebook ensuring everyone follows the same rules in a game. DOM
is like a game board, allowing players (programmers) to interact with the
elements.
6. Cascading Style Sheets (CSS) and Their Types:
• Explanation:
• CSS is used to style HTML elements. Types include inline, internal (in the head),
and external (in a separate file).
• Real-world example:
• If HTML is the structure of a building, CSS is the paint and decoration, making it
visually appealing. Different types represent how and where the decoration is
applied.
7. JavaScript:
• Explanation:
• JavaScript is a programming language that adds interactivity to web pages.
• Real-world example:
• On a news website, JavaScript might be used to create a dynamic feature that
updates the latest headlines without requiring a page refresh.
Unit 3 –

1. Introduction to XML (eXtensible Markup Language):


• Explanation:
• XML is a markup language similar to HTML but allows users to define their own
tags. It's used for storing and transporting data.
• Real-world example:
• Imagine an address book where each entry has custom tags like <name>,
<email>, and <phone>, making it easy to organize and exchange information.
2. XML vs HTML, Uses of XML:
• Explanation:
• XML is for data representation and exchange, while HTML is for presenting and
formatting data. XML is widely used for data interchange between different
systems.
• Real-world example:
• HTML is like the format of a book, while XML is like the data structure that stores
the book's information, such as author, title, and chapters.
3. Simple XML, XML Key Components:
• Explanation:
• Simple XML involves well-structured documents with elements, attributes, and
content.
• Real-world example:
• In a recipe XML file, elements like <ingredient> and <step> with attributes such
as <quantity> and <time> can represent the recipe details.
4. DTD (Document Type Definition) and Schemas:
• Explanation:
• DTD and Schemas define the structure and constraints of XML documents,
ensuring data consistency.
• Real-world example:
• DTD or Schema is like a blueprint for a form. If you have a form for entering
customer information, the DTD or Schema ensures that each customer record
follows a specific format.
5. Embedding XML into HTML Documents:
• Explanation:
• XML data can be embedded into HTML documents to combine the structure of
XML with the presentation of HTML.
• Real-world example:
• Embedding XML in an HTML page might be used to display dynamic data, like
weather updates, within a website.
6. Transforming XML using CSS, XSL, and XSLT:
• Explanation:
• CSS, XSL (eXtensible Stylesheet Language), and XSLT (XSL Transformations) are
used to style and transform XML documents.
• Real-world example:
• Think of XSLT as a chef transforming raw ingredients (XML data) into a dish
(styled and formatted output) using a recipe (XSL stylesheet).
Unit 4 –

1. PHP: Working with Variables and Constants:


• Explanation:
• PHP is a server-side scripting language. Variables store data, and constants hold
values that don't change during script execution.
• Real-world example:
• If you have a website that needs to display the current date, a variable can hold
that information, and a constant can store the maximum file upload size.
2. Controlling Program Flow:
• Explanation:
• PHP uses control structures like if statements, loops, and switches to control the
flow of the program.
• Real-world example:
• In a shopping website, if the user's cart is empty, you may want to display a
message encouraging them to add items before proceeding.
3. Working with Functions:
• Explanation:
• Functions in PHP allow you to group code into reusable blocks, improving code
organization.
• Real-world example:
• Imagine a function that calculates the total cost of items in a shopping cart. You
can reuse this function whenever you need to calculate the total.
4. Arrays:
• Explanation:
• Arrays in PHP store multiple values under a single variable name, making it easy
to manage and manipulate lists of data.
• Real-world example:
• An array can represent a list of product names, allowing you to easily loop
through and display them on a webpage.
5. Files and Directories:
• Explanation:
• PHP can read, write, and manipulate files and directories on the server.
• Real-world example:
• When a user uploads a profile picture, PHP can handle the file upload, save it to
the server, and update the user's profile with the file path.
6. Working with Forms and Databases:
• Explanation:
• PHP is commonly used to process form data and interact with databases to store
or retrieve information.
• Real-world example:
• A registration form on a website can use PHP to validate user input and store the
registration details in a database.
7. Introduction to Servlet, Lifecycle, API, and Servlet Packages:
• Explanation:
• Servlets are Java classes that extend the capabilities of servers. They have a
lifecycle, defined API, and use packages for functionality.
• Real-world example:
• If you have a Java-based web application, a servlet could handle user
authentication, managing user sessions throughout their interaction with the
site.

Unit 5 –

1. Introduction to Java Server Page (JSP):


• Explanation:
• JSP is a technology used to create dynamic web pages with Java. It allows
embedding Java code within HTML.
• Real-world example:
• A JSP page can be used to dynamically generate personalized welcome messages
based on user data retrieved from a database.
2. JSP Application Design:
• Explanation:
• JSP application design involves structuring your web application to effectively
use JSP for dynamic content.
• Real-world example:
• Designing a blog using JSP where each page is dynamically generated based on
the blog post content stored in a database.
3. JSP Objects:
• Explanation:
• JSP provides predefined objects like request, response, session, and application
to handle various aspects of web development.
• Real-world example:
• Using the request object in a JSP page to retrieve user input from a form.
4. Conditional Processing, Declaring Variables and Methods:
• Explanation:
• JSP allows for conditional statements (if, else) and declaring variables and
methods to control program flow.
• Real-world example:
• Using a conditional statement in a JSP page to display different content based on
user roles.
5. Sharing Data between JSP Pages:
• Explanation:
• JSP allows data sharing between different pages using request attributes,
session, and application scopes.
• Real-world example:
• Storing user authentication details in a session to maintain login state across
multiple pages.
6. Sharing Session and Application Data:
• Explanation:
• JSP supports sharing data between users (session) and across the entire
application (application scope).
• Real-world example:
• Storing a counter in the application scope to keep track of the total number of
visitors to a website.
7. Database Programming using JDBC:
• Explanation:
• JDBC (Java Database Connectivity) allows Java applications, including JSP, to
interact with databases.
• Real-world example:
• Using JDBC in a JSP page to retrieve and display product information from a
database.
8. Web Application Framework, MVC Framework:
• Explanation:
• A web application framework provides a structured way to build web
applications. MVC (Model-View-Controller) is a design pattern that separates
application concerns.
• Real-world example:
• Using a web application framework like Spring MVC to organize code and
manage the flow of data in a Java-based web application.
9. Introduction to Bootstrap, Angular JS:
• Explanation:
• Bootstrap is a CSS framework for responsive web design. AngularJS is a
JavaScript framework for building dynamic web applications.
• Real-world example:
• Using Bootstrap to create a mobile-friendly navigation bar or integrating
AngularJS for real-time updates in a web application.
MCQ’s to Remember-
Q1:
i. Which of the following is not a web server? (a) JBoss
ii. _________ concept uses two or more protocols for its operation? (b) Email
iii. ‘A record’ is used in web publishing for? (a) Points to IP address
iv. CSS helps in? (d) All of these
v. XSL stands for? (b) Extensible Stylesheet Language
vi. XML can be parsed using? (c) Both (a) and (b)
vii. Not a benefit of PHP? (d) Bytecode
viii. ________ is a part of the servlet life cycle? (c) init()
ix. Used to maintain state in HTTP? (d) All of these
x. Expression is related to? (c) JSP scripting
Q2:
i. The default connection type used by HTTP is? (a) Persistent
ii. SMTP uses the TCP port? (d) 25
iii. From which tag does a descriptive list start? (c) <DL>
iv. The type of a variable that is volatile in JavaScript? (b) Mutable variable
v. DTD's are? (a) Ways to create templates for output types
vi. XSL is? (a) An XML based language to create style sheets
vii. Which of the following code is used to set content type of a page to be serviced using
servlet? (a) response.setContentType()
viii. Which one of the following PHP functions can be used to build a function that accepts any
number of arguments? (b) func_get_argc()
ix. Which of the following method can be used to read multiple values with the same name,
for example, checkbox selections? (c) request.getParameterValues()
x. What are common methods for detecting the type of browser running on a client? (a) Use
JavaScript to query for the userAgent header
Q3:
i. Which protocol deals with emails? (b) SMTP
ii. Which protocol ensures reliable delivery? (a) TCP
iii. Which of the following is the correct syntax to display hyperlinks without any underline?
(c) A {text-decoration: none;}
iv. Which of the following property is used as the shorthand property for the padding
properties? (c) Padding
v. XML is a text-based markup language derived from? (c) SGML
vi. Which of the following is false? (a) XML cannot be used for offloading and reloading of
databases.
vii. Variable name in PHP starts with? (b) $ (Dollar)
viii. Which of the following is not a variable scope in PHP? (a) Extern
ix. Which of the following statements is/are correct about Bootstrap? (d) All of these
x. Who is/are the developers of Bootstrap? (a) Mark Otto and Jacob Thornton
2018 –

.2
i. Differentiate between Intranet and Internet. (3 marks)
• Intranet (1 mark): It is a private network within an organization.
• Internet (1 mark): It is a global network connecting millions of public and private
networks.
ii. Functionalities provided by Application Server (6 marks)
1. Servlet and JSP Support (1 mark): Handles Java servlets and JavaServer Pages.
2. Transaction Management (1 mark): Manages transactions in database operations.
3. Security (1 mark): Provides security features like authentication and authorization.
4. Database Connection Pooling (1 mark): Manages a pool of database connections for
efficient use.
5. Load Balancing (1 mark): Distributes incoming network traffic across multiple servers.
6. Concurrency Control (1 mark): Manages concurrent access to shared resources.
At least two Application Servers (2 marks)
1. Apache Tomcat (1 mark)
2. WildFly (1 mark)
OR iii. Describe the Hierarchy of Domain Name Servers (8 marks)
• TLD (2 marks): Top-Level Domain servers, e.g., ".com", ".org".
• Root (2 marks): The highest level of the DNS hierarchy.
• Name Servers (3 marks): Servers that store DNS records for a domain.
• Example (1 mark): Example.com as an illustration.
Q.3
i. Explain Document Object Model with an example (3 marks)
• Document Object Model (2 marks): Represents a structured document as a tree of
objects.
• Example (1 mark): Demonstrates manipulating HTML elements using JavaScript.
ii. Steps for Website Planning (7 marks)
1. Define Purpose (1 mark): Clarify the website's goals.
2. Identify Target Audience (1 mark): Know the intended users.
3. Plan Content (1 mark): Decide on the information to be presented.
4. Organize Content (1 mark): Structure content logically.
5. Design Navigation (1 mark): Plan how users will navigate the site.
6. Choose Technology (1 mark): Decide on tools and frameworks.
7. Test and Launch (1 mark): Ensure functionality and deploy.
OR iii. "List" Tag (7 marks)
• List Tag (2 marks): Used to create a list.
• Types of Lists with Example (5 marks): Ordered list <ol>, unordered list <ul>, definition
list <dl> with examples.
Q.4
i. XML Proves to be the Base for Web Technologies (4 marks)
• Structured Data (2 marks): XML provides a structured format for data representation.
• Interoperability (2 marks): Allows seamless data exchange between different systems.
ii. CSS (3 marks)
• Cascading Style Sheets (1 mark): Used for styling HTML elements.
• XSL (3 marks): Extensible Stylesheet Language used for transforming XML.
OR iii. Scenario to Justify the Need of XML Transformation (6 marks)
• Data Integration (2 marks): XML transformation facilitates integrating data from diverse
sources.
• Standardization (2 marks): Allows standardizing data format for consistency.
• Cross-platform Communication (2 marks): XML transforms enable communication
between systems with different data formats.
Q.5
i. Javax-servlet.jar (4 marks)
• Javax-servlet.jar (2 marks): It's a Java Archive file containing servlet-related classes.
• Interfaces of javax.servlet package (2 marks): Include Servlet, ServletConfig,
ServletContext, etc.
ii. PHP Program to Specify Age of Every Student (6 marks)

<?php
$studentAges = array("John" => 20, "Mary" => 22, "Bob" => 21);

foreach ($studentAges as $student => $age) {


echo "$student's age is $age <br>";
}
?>

OR iii. Servlet Objects Used to Interact with Form Elements (6 marks)


• ServletRequest (1 mark): Represents client request.
• ServletResponse (1 mark): Represents server response.
• HttpServlet (1 mark): A base class for HTTP-specific servlets.
• HttpServletRequest (1 mark): Extends ServletRequest, provides HTTP-specific methods.
• Method to Retrieve Form Input Value (2 marks):
request.getParameter("parameterName") to retrieve form input.
Q.6 (Choose any two)
i. Different JSP Implicit Objects (5 marks)
1. request (1 mark): Represents client request.
2. response (1 mark): Represents server response.
3. session (1 mark): Represents user session.
4. application (1 mark): Represents web application.
5. out (1 mark): Output stream for writing to the client.
ii. Angular JS (5 marks)
• Angular JS (3 marks): JavaScript framework for dynamic web applications.
• Example (2 marks): Showing a simple AngularJS controller and data binding.
iii. Comparison of Servlet with JSP (5 marks)
• Servlet (3 marks): Java class, handles requests and responses.
• JSP (2 marks): Mix of HTML and Java, simplifies page creation.

2019-

Q.2
i. What is DNS? How does it function? (2 marks)
• DNS Definition (1 mark): DNS stands for Domain Name System, it translates human-
readable domain names into IP addresses.
• Function (1 mark): DNS functions as a distributed database that resolves domain names
to IP addresses, allowing computers to locate each other on the internet.
ii. Basic Structure of HTTP Request and Response Message Structure (3 marks)
HTTP Request:
• Request Line (1 mark): GET /path/resource HTTP/1.1
• Headers (1 mark): Host, User-Agent, etc.
• Body (0.5 marks): Optional data sent with the request.
HTTP Response:
• Status Line (1 mark): HTTP/1.1 200 OK
• Headers (1 mark): Content-Type, Content-Length, etc.
• Body (0.5 marks): Data sent as a response.
iii. Functions of Web Browser and Server Communication (5 marks)
• Web Browser Functions (3 marks):
1. Rendering (1 mark): Displaying HTML, CSS, and JavaScript content.
2. User Interface (1 mark): Providing an interface for user interaction.
3. Data Storage (1 mark): Storing cookies, local storage.
• Server Communication Functions (2 marks):
1. Request Sending (1 mark): Initiating requests to servers.
2. Response Handling (1 mark): Processing and rendering server responses.
OR iv. Architecture of WWW (5 marks)
• Diagram (2 marks): Illustrating components like clients, servers, browsers.
• Explanation (3 marks): Detailing the interaction between clients and servers in the
World Wide Web.
Q.3
i. Define Document Object Model (2 marks)
• Document Object Model (2 marks): It's a programming interface for web documents. It
represents the document as a tree of objects.
ii. HTML Text Formatting Tags with Examples (8 marks)
1. Bold (2 marks): <b>...</b>
2. Italic (2 marks): <i>...</i>
3. Underline (2 marks): <u>...</u>
4. Strike-through (2 marks): <s>...</s>
OR iii. JavaScript Program to Find Largest Among 5 Numbers (8 marks)
var numbers = [5, 8, 2, 10, 3];
var max = Math.max(...numbers);
console.log("The largest number is: " + max);

Q.4
i. XSLT is Important for XML (2 marks)
• XSLT Importance (2 marks): XSLT (Extensible Stylesheet Language Transformations) is
crucial for transforming XML documents into different formats, aiding in presentation
and data exchange.
ii. Three Rules for Writing XML (3 marks)
1. Well-Formed Structure (1 mark): Elements must be properly nested, and tags closed
correctly.
2. Valid Document (1 mark): Follow a defined DTD or XML Schema.
3. Reserved Characters (1 mark): Special characters like <, >, & should be escaped or used
within CDATA sections.
iii. Define DTD, Explain Various Types of DTD (5 marks)
• Definition of DTD (1 mark): Document Type Definition specifies the structure of an XML
document.
• Various Types of DTD (4 marks):
1. Internal DTD (1 mark): DTD defined within the XML document.
2. External DTD (1 mark): DTD defined in a separate file.
3. Parameter Entity (1 mark): Reusable entity declarations.
4. General Entity (1 mark): Represents general text.
OR iv. XML Processing Model with Example (5 marks)
• XML Processing Model (3 marks): Illustrate how XML documents are processed from
parsing to data extraction.
• Example (2 marks): Showing a simple XML document and how data can be extracted
using XPath.
Q.5 (Choose any two)
i. PHP Program to Print Factorial of Any Number (5 marks)
<?php
function factorial($n) {
if ($n === 0 || $n === 1) {
return 1;
} else {
return $n * factorial($n - 1);
}
}

$number = 5;
echo "Factorial of $number is: " . factorial($number);
?>
ii. PHP Program to Find Whether a Number is Armstrong or Not (5 marks)
<?php
function isArmstrong($num) {
$originalNum = $num;
$sum = 0;
$n = strlen($num);

while ($num != 0) {
$digit = $num % 10;
$sum += pow($digit, $n);
$num /= 10;
}

return ($sum == $originalNum);


}

$number = 153;
echo ($number . " is " . (isArmstrong($number) ? "an Armstrong number" : "not an Armstrong
number"));
?>
iii. Briefly Explain Life Cycle of Servlet (5 marks)
• Diagram (2.5 marks): Illustrating phases like initialization, service, and destruction.
• Description (2.5 marks): Detailing each phase's purpose and activities.
Q.6 (Choose any two)
i. Explain AngularJS Boot Process (5 marks)
• Initialize (1.5 marks): Initialization phase, module loading.
• Execution (2 marks): Execution phase, compilation of HTML.
• Calling (1.5 marks): AngularJS calls functions as required.
ii. Explain Lifecycle of a JSP (5 marks)
• Diagram (2 marks): Representing phases like translation, compilation, and execution.
• Explanation (3 marks): Describing each phase's role and activities.
iii. Explain Any Five Attributes of Page Directive (5 marks)
1. Language (1 mark): Specifies the scripting language used in the JSP page.
2. ContentType (1 mark): Defines the MIME type of the response.
3. Session (1 mark): Controls session behavior for the page.
4. Buffer (1 mark): Sets the buffer size for the page.
5. AutoFlush (1 mark): Specifies whether to flush the buffer automatically.

2022-

Q.2
i. Define WWW (3 marks)
• Definition (3 marks): The World Wide Web (WWW) is a system of interlinked hypertext
documents accessed via the internet. It allows users to view and navigate text,
multimedia, and other content through web browsers.
ii. Description Along With Diagram of HTTP Request and Response Protocol (7 marks)
• Diagram (HTTP Request and Response Protocol) (1.5 marks): Illustrating components
like Request Line, Headers, and Body in both HTTP Request and Response.
• Get Methods (1.5 marks): Brief explanation and example.
• Post Methods (1.5 marks): Brief explanation and example.
• Examples (1 mark): Providing practical examples of GET and POST methods.
OR iii. Differentiate Between Web Servers and Application Servers (7 marks)
• Purpose (1 mark): Web servers serve web pages, while application servers handle
application logic.
• Usefulness (1 mark): Web servers are for static content, while application servers
process dynamic content.
• Resource Consumption (1 mark): Application servers typically consume more resources
due to application processing.
• Target Environment (1 mark): Web servers focus on serving content to clients, while
application servers handle application-specific tasks.
• Multithreading Support (1 mark): Application servers often support multithreading for
concurrent requests.
• Protocols Supported (1 mark): Both support HTTP, but application servers may handle
additional protocols.
• Example (1 mark): Apache HTTP Server as a web server, and Tomcat as an application
server.
Q.3
i. DOM in HTML (As per the explanation) (2 marks)
• DOM in HTML (2 marks): Document Object Model represents the structured document
as a tree of objects in HTML.
ii. Write DTD for the Given XML Code (3 marks)
xmlCopy code
<?xml version="1.0"?> <!DOCTYPE note [ <!ELEMENT note (to, from, heading, body)>
<!ELEMENT to (#PCDATA)> <!ELEMENT from (#PCDATA)> <!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)> ]>
OR iii. HTML List and Tables (5 marks)
• HTML List (2.5 marks): Showing usage of <ul> and <li> for an unordered list.
• HTML Tables (2.5 marks): Demonstrating the structure of an HTML table.
OR iv. Rules to Declare Variable in JavaScript and Types of JavaScript Data Types (5 marks)
• Rules to Declare Variable in JavaScript (2.5 marks): Examples: var, let, const.
• Types of JavaScript Data Types (2.5 marks): Examples: Number, String, Boolean, Object.
Q.4
i. Three Main Components of XSL (1 mark each) (3 marks)
1. XSLT (Transformation)
2. XPath (Navigation)
3. XSL-FO (Formatting Objects)
ii. CSS, Advantages, and Disadvantages of Displaying XML Using CSS (7 marks)
• CSS (1 mark): Cascading Style Sheets for styling XML documents.
• Advantages (3 marks):
1. Separation of Concerns (1 mark): Separates content from presentation.
2. Consistency (1 mark): Maintains consistent styling across documents.
3. Reusability (1 mark): Styles can be reused across multiple documents.
• Disadvantages (3 marks):
1. Browser Compatibility (1 mark): May not display consistently across all
browsers.
2. Limited Layout Control (1 mark): Limited compared to other layout methods.
3. Complexity (1 mark): May become complex for intricate designs.
OR iii. XML, Difference from HTML, and Complimenting Each Other (7 marks)
• XML (2 marks): Extensible Markup Language, designed for data interchange.
• Difference from HTML (3 marks): Focus on data structure, not presentation;
extensibility.
• Complimenting Each Other (2 marks): XML provides structure, while HTML provides
presentation.
Q.5
i. Draw and Explain Lifecycle of Servlet (As per the explanation) (4 marks)
• Diagram (As per the explanation) (2 marks): Representing phases like initialization,
service, and destruction.
• Explanation (As per the explanation) (2 marks): Detailing each phase's purpose and
activities.
ii. Role of Cookies and Its Creation (As per the explanation) (6 marks)
• Role of Cookies (3 marks): Storing user information, tracking sessions, personalization.
• Creation (3 marks): Setting cookies using the Set-Cookie header in the HTTP response.
OR iii. Features of PHP (6 marks)
• Server-Side Scripting (1 mark): Executes on the server to generate dynamic content.
• Open Source (1 mark): Freely available with a large community.
• Database Support (1 mark): Provides support for various databases.
• Platform Independence (1 mark): Works on multiple platforms.
• Security (1 mark): Offers security features.
• Extensibility (1 mark): Supports extensions and custom modules.
Q.6 (Choose Any Two)
i. JSP (As per the explanation) (5 marks)
• Explanation (As per the explanation): Describing JavaServer Pages and their role in
dynamic web content.
ii. JDBC (As per the explanation) (5 marks)
• Explanation (As per the explanation): Detailing the Java Database Connectivity API and
its use in connecting Java applications to databases.
iii. MVC Framework (As per the explanation) (5 marks)
• Explanation (As per the explanation): Describing the Model-View-Controller framework
and its role in software architecture.
Life Cycle of servlet-

Http req. response protocol-


Web & applications server-

S.NO Web Server Application Server

Web server encompasses web container Application server encompasses Web


1. only. container as well as EJB container.

Web server is useful or fitted for static Application server is fitted for dynamic
2. content. content.

Web server consumes or utilizes fewer


3. resources. Application server utilizes more resources.

Web servers arrange the run Application servers arrange the run
4. environment for web applications. environment for enterprise applications.

In web servers, multithreading is In application servers, multithreading is not


5. supported. supported.

Web server’s capacity is lower than the Application server’s capacity is higher than
6. application server. the web server.

In web servers, HTML and HTTP In application servers, GUI as well as HTTP
7. protocols are used. and RPC/RMI protocols are used.
S.NO Web Server Application Server

Processes that are not resource-intensive Processes that are resource-intensive are
8. are supported. supported.

Transactions and connection pooling are Transactions and connection pooling are
9. not supported. supported.

The capacity of fault tolerance is low Application servers have high fault
10. compared to application servers. tolerance.

Web Server examples: Apache HTTP Application Server examples: JBoss,


11. Server, Nginx. Glassfish.
Feature Servlet JSP

JSP is an HTML-based compilation


Nature Servlet is a Java code. code.

Writing code for servlet is harder JSP is easy to code as it is Java in


Ease of Coding than JSP as it is HTML in Java. HTML.

Servlet plays a controller role in JSP is the view in the MVC approach
MVC Role the MVC approach. for showing output.
Feature Servlet JSP

JSP is slower than Servlet because of


the JSP-to-Java code translation and
Performance Servlet is faster than JSP. compilation.

Protocol Servlet can accept all protocol


Handling requests. JSP only accepts HTTP requests.

service() Method In Servlet, we can override the In JSP, we cannot override its service()
Override service() method. method.

Session In Servlet, session management is In JSP, session management is


Management not enabled by default. automatically enabled.

In Servlet, business logic and


Separation of presentation logic are In JSP, business logic is separated from
Logic implemented in one file. presentation logic using JavaBeans.

Modification in Servlet is a time- JSP modification is fast and requires


Modification consuming compiling task. just a refresh.

Servlet does not have inbuilt


Implicit Objects implicit objects. JSP has inbuilt implicit objects.

Servlet does not have a method


Client-Side for running JavaScript on the JSP allows running JavaScript for
JavaScript client side. client-side validation.

Packages can be imported at the


Packages are to be imported at bottom, middle, or top of the JSP
Package Import the top of the program. program.

Data Processing Servlet can handle extensive data JSP cannot handle extensive data
Capability processing. processing very efficiently.

Servlets do not have the facility JSP has the facility for writing custom
Custom Tags for writing custom tags. tags.

JSP is compiled into Java Servlets


Execution Servlets are hosted and executed before execution, having a similar
Environment on Web Servers. lifecycle as Servlets.

You might also like