0% found this document useful (0 votes)
10 views17 pages

WT Oral Ans

The document provides an overview of web technology, including definitions and examples of various web terminologies, client-side and server-side technologies, markup and scripting languages, and HTML/CSS basics. It also covers advanced topics like XML, DTD, XML Schema, JavaScript, JSP, and EJB, along with comparisons between different technologies and frameworks. Additionally, it includes code examples for creating HTML forms, tables, and connecting to databases using various programming languages.

Uploaded by

Kadam Sharad
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)
10 views17 pages

WT Oral Ans

The document provides an overview of web technology, including definitions and examples of various web terminologies, client-side and server-side technologies, markup and scripting languages, and HTML/CSS basics. It also covers advanced topics like XML, DTD, XML Schema, JavaScript, JSP, and EJB, along with comparisons between different technologies and frameworks. Additionally, it includes code examples for creating HTML forms, tables, and connecting to databases using various programming languages.

Uploaded by

Kadam Sharad
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/ 17

1) What is Web Technology?

Web technology refers to the tools, languages, and protocols used to communicate between devices
over the internet and create web-based applications and websites.

2) What are different Web Terminologies?

• URL: Uniform Resource Locator

• HTTP/HTTPS: Protocols for transferring data

• Web Browser: Software to access web content (Chrome, Firefox)

• Web Server: Hosts websites (Apache, IIS)

• HTML: Markup language for web pages

• CSS: Styling for web pages

• JavaScript: Adds interactivity

• API: Interface for application communication

3) What is Client-Side Technology? Examples:


Technologies that run on the user's browser.
Examples: HTML, CSS, JavaScript, Angular, React

4) What is Server-Side Technology? Examples:


Technologies that run on the server, process data, and send it to the client.
Examples: PHP, Node.js, ASP.NET, Python (Django/Flask), Java (Spring)

5) What is a Markup Language? Examples:


A language that defines the structure of a document using tags.
Examples: HTML, XML, XHTML

6) What is Scripting Language? Examples:


A programming language used to automate tasks inside applications.
Examples: JavaScript, PHP, Python, Perl

7) Compare Markup Language with Scripting Language


(with Examples)

• Markup Language: Structures content (HTML, XML)

• Scripting Language: Adds behavior (JavaScript, PHP)


Example: HTML creates a button, JavaScript makes it clickable.
8) What is HTML?
HTML (HyperText Markup Language) is the standard language for creating web pages and
applications.

Elements/Tags of HTML:

• <html>

• <head>

• <title>

• <body>

• <h1> to <h6>

• <p>

• <a>

• <table> etc.

9) Basic Five Elements for "Hello World" html

CopyEdit

<!DOCTYPE html>

<html>

<head>

<title>Hello World</title>

</head>

<body>

<h1>Hello World</h1>

</body>

</html>

10) Correct an HTML code If you share the code, I’ll


correct it.

11) Write HTML code to display a table & apply CSS

html

CopyEdit
<!DOCTYPE html>

<html>

<head> <style> table, th,

td { border: 1px solid

black; border-collapse:

collapse; padding: 10px;

</style>

</head>

<body>

<table>

<tr><th>Name</th><th>Age</th></tr>

<tr><td>John</td><td>25</td></tr>

<tr><td>Alice</td><td>22</td></tr>

</table> </body>

</html>

12) What is CSS? Types of CSS


CSS (Cascading Style Sheets) styles web pages.

Types:

1. Inline CSS

2. Internal CSS

3. External CSS

13) Code to Demonstrate CSS Types html

CopyEdit

<!-- Inline CSS -->

<h1 style="color:blue;">Hello World</h1>

<!-- Internal CSS -->


<style> p {

color:green; }

</style>

<p>This is a paragraph.</p>

<!-- External CSS -->

<link rel="stylesheet" href="styles.css">

14) What is XML? Code to display Hello World

XML (eXtensible Markup Language) stores and transports data. xml

CopyEdit

<?xml version="1.0"?>

<message>Hello World</message>

15) Compare HTML & XHTML

• HTML: Flexible, no strict rules

• XHTML: Strict syntax, case-sensitive, all tags closed

16) Compare HTML & XML

HTML XML

Displays data Stores/transports data

Predefined tags User-defined tags

Not strict Strict syntax

17) What is DTD? Example Document Type Definition defines the structure and legal elements of an
XML document.

Example:
xml

CopyEdit

<!DOCTYPE note [

<!ELEMENT note (to,from,heading,body)>


]>

18) What is XML Schema? An XML Schema defines the structure, content, and data types of XML
documents (more powerful than DTD).

Compare DTD & XML Schema

DTD XML Schema

Limited data types Rich data types

Not namespace aware Namespace aware

Older technology Newer and recommended

19) Create XML Schema for Employee xml

CopyEdit

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="employee">

<xs:complexType>

<xs:sequence>

<xs:element name="id" type="xs:int"/>

<xs:element name="name" type="xs:string"/>

<xs:element name="department" type="xs:string"/>

<xs:element name="salary" type="xs:decimal"/>

</xs:sequence>

</xs:complexType>

</xs:element>

</xs:schema>

20) Write DTD Schema for Employee Details

Example:
xml

CopyEdit

<!DOCTYPE employee [

<!ELEMENT employee (id, name, department, salary)>

<!ELEMENT id (#PCDATA)>
<!ELEMENT name (#PCDATA)>

<!ELEMENT department (#PCDATA)>

<!ELEMENT salary (#PCDATA)>

]>

21) Write XML Schema for Students Details

Example: xml

CopyEdit

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="student">

<xs:complexType>

<xs:sequence>

<xs:element name="rollno" type="xs:int"/>

<xs:element name="name" type="xs:string"/>

<xs:element name="course" type="xs:string"/>

<xs:element name="marks" type="xs:decimal"/>

</xs:sequence>

</xs:complexType>

</xs:element>

</xs:schema>

22) What is JavaScript?


JavaScript is a lightweight, interpreted scripting language mainly used to create dynamic and
interactive content on web pages. It runs on the client side (browser).

23) What is DOM? Methods of DOM


DOM (Document Object Model) is a programming interface that allows scripts to dynamically access
and update the content, structure, and style of documents.

Methods of DOM:

• getElementById()

• getElementsByClassName()

• getElementsByTagName()
• querySelector()

• querySelectorAll()

• createElement()

• appendChild()

• removeChild()

24) Validations Using JavaScript Example: Validate Empty Input Field html

CopyEdit <script> function validateForm() { let name =

document.forms["myForm"]["username"].value;

if (name == "") { alert("Name

must be filled out");

return false;

</script>

<form name="myForm" onsubmit="return validateForm()">

Name: <input type="text" name="username">

<input type="submit" value="Submit">

</form>

25) What is Session Management in JavaScript?

JavaScript itself doesn’t manage sessions on the server, but it can store data locally in the browser.

Techniques:

• localStorage (persists data)

• sessionStorage (cleared when tab is closed)

• cookies (store small data pieces)

Example: javascript CopyEdit

sessionStorage.setItem("username", "John");

alert(sessionStorage.getItem("username"));
26) Difference Between doGet and doPost
doGet doPost

Data sent in URL Data sent in request body

Limited data size Large data size

Less secure More secure

Bookmarked Cannot be bookmarked


Used for fetching data Used for sending data

27) What is a Servlet? Servlet Lifecycle

Servlet is a Java program that runs on a server, handles client requests and generates responses
(usually HTML).

Servlet Lifecycle:

1. Initialization (init()): Called once when servlet is created.

2. Request Handling (service()): Called each time the servlet handles a client request.

3. Destruction (destroy()): Called when servlet is removed from service.

Lifecycle Flow:

• Client makes request

• Servlet container loads servlet

• init() → service() → destroy()

28) What is JSP? JSP lifecycle.

• JSP (Java Server Pages) is a technology to create dynamic web pages using Java on the server
side. It allows embedding Java code in HTML pages.

• JSP Lifecycle:

1. Translation: JSP file is converted into a Servlet.

2. Compilation: The Servlet (Java file) is compiled into a class.

3. Loading: The class is loaded into memory.

4. Instantiation: An object of the servlet is created.

5. Initialization: jspInit() method is called.

6. Request handling: jspService() method is called for each request.

7. Destruction: jspDestroy() method is called when JSP is unloaded.


29) Compare Servlet with JSP.

Servlet JSP

Pure Java code. Mixture of HTML and Java code.

Harder to maintain for large HTML. Easier to manage presentation.

Better for complex logic. Better for displaying data.

Must manually handle response writing. Automatically handles HTML output.

30) Compare Servlet lifecycle with JSP lifecycle.

Servlet Lifecycle JSP Lifecycle

Translation → Compilation → jspInit(), jspService(),


init(), service(), destroy() methods.
jspDestroy().

No translation or compilation phase at


Extra steps: translation and compilation.
runtime.

Directly Java code. JSP internally becomes a servlet.

31) Explain procedure to connect Servlet with MySQL database.

1. Load MySQL JDBC driver:

java

CopyEdit

Class.forName("com.mysql.cj.jdbc.Driver");

2. Create a connection:

java

CopyEdit

Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/dbname",


"username", "password");

3. Create Statement and execute query.

4. Close the connection.

32) Explain procedure to connect JSP with MySQL database.


• Same as Servlet:

1. Load the driver.

2. Get a Connection object.

3. Execute SQL queries.

4. Close connection.

• Code example inside JSP:

jsp

CopyEdit

<%

Class.forName("com.mysql.cj.jdbc.Driver");

Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/dbname", "user",


"pass");

Statement stmt = con.createStatement();

ResultSet rs = stmt.executeQuery("SELECT * FROM table");

while(rs.next()) {

out.println(rs.getString("column"));

con.close();

%>

33) What is PHP?

• PHP (Hypertext Preprocessor) is a server-side scripting language designed for web


development to create dynamic web pages.

34) Explain procedure to connect PHP with MySQL database.

• Use mysqli or PDO extension.

• Example using mysqli:

php

CopyEdit

<?php

$conn = new mysqli("localhost", "username", "password", "dbname");


if ($conn->connect_error) {

die("Connection failed: " . $conn->connect_error);

$result = $conn->query("SELECT * FROM table");

while($row = $result->fetch_assoc()) {

echo $row['column'];

$conn->close();

?>

35) What is Struts?

• Struts is a Java framework for building web applications using the MVC (Model-View-
Controller) design pattern.

36) How validations are achieved using Struts?

• In Struts, validations are handled:

o Using validate() method inside ActionForm class.

o Using validation.xml for declarative validations.

o By custom validation logic or prebuilt validators.

37) Compare jQuery and Struts.

jQuery Struts

JavaScript library (client-side). Java framework (server-side).

Handles DOM manipulation, AJAX calls. Handles business logic and web requests.

Lightweight. Heavyweight.

For UI effects and events. For server-side request processing.

38) Compare validations using JavaScript, jQuery & Struts.

Feature JavaScript jQuery Struts

Client-side. Client-side. Server-side.


Feature JavaScript jQuery Struts

Manual coding needed. Easier with plugins. Inbuilt server-side validators.

Immediate feedback. Immediate feedback with easy syntax. Validation after form submit.

39) What is AngularJS?

• AngularJS is a JavaScript framework developed by Google used for building dynamic web
applications with two-way data binding.

40) What are directives of AngularJS?

• Directives are markers on HTML elements that tell AngularJS to attach a behavior.

• Examples: ng-app, ng-model, ng-repeat, ng-if.

41) Compare ng-app, ng-init, ng-model.

Directive Purpose

ng-app Defines the root element of the AngularJS application.

ng-init Initializes application data.

ng-model Binds the value of HTML controls to application data.

42) Compare AngularJS with Node.js.

AngularJS Node.js

Front-end framework. Back-end runtime environment.

Runs in the browser. Runs on the server.

Used to build dynamic web apps. Used to build server-side apps and APIs.

43) What is EJB?

• EJB (Enterprise JavaBeans) is a server-side software component that encapsulates business


logic of an application.

44) Explain architecture of EJB.

• EJB has three layers:


1. Client Layer: User or application requesting service.

2. EJB Container: Manages EJB life cycle, security, transactions.

3. Database: Stores persistent data.

45) Types of EJB.

• Session Beans: Handle business logic.

• Entity Beans: Represent database entities (deprecated in EJB 3.0).

• Message-Driven Beans: Handle asynchronous messaging.

46) Compare Stateful & Stateless session beans.

Stateful Bean Stateless Bean

Maintains client state. No client state maintained.

One bean per client. Same bean shared by multiple clients.

Example: Shopping cart. Example: Login validation.

47) What is the application of EJB?

• EJB is used in enterprise applications needing features like transactions, security, concurrency,
and remote access.

48) What are web services?

• Web services are software systems that allow communication between different applications
over the network using standard protocols like HTTP, XML, SOAP.

49) What is WSDL?

• WSDL (Web Services Description Language) is an XML document that describes how to
communicate with a web service: what operations are available and how to call them.

50) What are interceptors in Struts?

• Interceptors in Struts are objects that can process requests before and after the execution of
an Action class.

• Example: Authentication check, Logging, File upload.


51) What is class?

• Class is a blueprint for creating objects in object-oriented programming. It defines variables


and methods common to all objects of the class.

52) What is ID selector and Contexted Selector?

• ID Selector (CSS/HTML):

o Selects an element by its unique ID.

o Example: #header { color: blue; }

• Contexted Selector:

o Selects elements based on their relationship.

o Example: div p → Selects all <p> inside <div>.

53) What are advantages of different style methods?

• Inline Styles: Quick changes, specific to a single element.

• Internal CSS: Good for small websites, easier management of styles in one page.

• External CSS: Reusability across multiple pages, easier maintenance.

54) What is the difference between element, attribute, and property?

Term Meaning

Element A basic building block of HTML (e.g., <input>, <p>).

Attribute Extra information given inside an element's tag (e.g., type="text").

Property A value associated with an object in the DOM (e.g., input.value in JavaScript).

55) What is HTML form?

• An HTML Form is used to collect user input and send it to the server for processing, using
tags like <form>, <input>, <textarea>, etc.

56) Write a HTML code to create form.

html

CopyEdit

<form action="/submit" method="post">


Name: <input type="text" name="username"><br>

Email: <input type="email" name="email"><br>

<input type="submit" value="Submit">

</form>

57) What is List in HTML?

• A List is used to group related items together.

• Three types: Ordered List (<ol>), Unordered List (<ul>), and Description List (<dl>).

58) Write HTML code to display ordered & unordered list.

html

CopyEdit

<h3>Ordered List:</h3>

<ol>

<li>Apple</li>

<li>Banana</li>

<li>Cherry</li>

</ol>

<h3>Unordered List:</h3>

<ul>

<li>Dog</li>

<li>Cat</li>

<li>Rabbit</li>

</ul>

59) What are frames of frameset?

• Frames divide a web page into multiple sections, each section can load a different HTML
page.

• Example:

html
CopyEdit

<frameset cols="50%,50%">

<frame src="left.html">

<frame src="right.html">

</frameset>

Note: Frameset is obsolete in HTML5.

60) What is DOCTYPE?

• DOCTYPE declaration tells the browser which version of HTML the page is written in.

• Example:

html

CopyEdit

<!DOCTYPE html>

61) What is service() in Servlet?

• service() method handles all client requests in a servlet.

• It automatically calls doGet(), doPost(), etc., based on the request type.

62) What are implicit objects in JSP?

• Implicit objects are predefined objects available in JSP without needing to declare them.

• Examples: request, response, session, application, out, config, pageContext, page, exception.

63) What are JSP directives?

• Directives provide instructions to the JSP container.

• Examples:

o page directive: Defines page settings (e.g., import classes).

o include directive: Includes a file during page translation.

o taglib directive: Declares a custom tag library.

Syntax example:

jsp

CopyEdit
<%@ page language="java" contentType="text/html" %>

64) What are the standard actions available in JSP?

• Standard actions allow transferring control, manipulating JavaBeans, or including other


resources.

• Examples:

o <jsp:include>: Include another resource.

o <jsp:forward>: Forward request to another resource.

o <jsp:useBean>, <jsp:setProperty>, <jsp:getProperty>: For JavaBeans.

65) What is client-server architecture?

• Client-server architecture is a network design where:

o Client: Sends requests (browser, app).

o Server: Processes and responds to those requests (web server, database server).

Example: When you open a website, your browser is the client and the web server hosts the site.

You might also like