WT Oral Ans
WT Oral Ans
Web technology refers to the tools, languages, and protocols used to communicate between devices
over the internet and create web-based applications and websites.
Elements/Tags of HTML:
• <html>
• <head>
• <title>
• <body>
• <h1> to <h6>
• <p>
• <a>
• <table> etc.
CopyEdit
<!DOCTYPE html>
<html>
<head>
<title>Hello World</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
html
CopyEdit
<!DOCTYPE html>
<html>
black; border-collapse:
</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>
Types:
1. Inline CSS
2. Internal CSS
3. External CSS
CopyEdit
color:green; }
</style>
<p>This is a paragraph.</p>
CopyEdit
<?xml version="1.0"?>
<message>Hello World</message>
HTML XML
17) What is DTD? Example Document Type Definition defines the structure and legal elements of an
XML document.
Example:
xml
CopyEdit
<!DOCTYPE note [
18) What is XML Schema? An XML Schema defines the structure, content, and data types of XML
documents (more powerful than DTD).
CopyEdit
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="employee">
<xs:complexType>
<xs:sequence>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Example:
xml
CopyEdit
<!DOCTYPE employee [
<!ELEMENT id (#PCDATA)>
<!ELEMENT name (#PCDATA)>
]>
Example: xml
CopyEdit
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="student">
<xs:complexType>
<xs:sequence>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Methods of DOM:
• getElementById()
• getElementsByClassName()
• getElementsByTagName()
• querySelector()
• querySelectorAll()
• createElement()
• appendChild()
• removeChild()
24) Validations Using JavaScript Example: Validate Empty Input Field html
document.forms["myForm"]["username"].value;
return false;
</script>
</form>
JavaScript itself doesn’t manage sessions on the server, but it can store data locally in the browser.
Techniques:
sessionStorage.setItem("username", "John");
alert(sessionStorage.getItem("username"));
26) Difference Between doGet and doPost
doGet doPost
Servlet is a Java program that runs on a server, handles client requests and generates responses
(usually HTML).
Servlet Lifecycle:
2. Request Handling (service()): Called each time the servlet handles a client request.
Lifecycle Flow:
• 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:
Servlet JSP
java
CopyEdit
Class.forName("com.mysql.cj.jdbc.Driver");
2. Create a connection:
java
CopyEdit
4. Close connection.
jsp
CopyEdit
<%
Class.forName("com.mysql.cj.jdbc.Driver");
while(rs.next()) {
out.println(rs.getString("column"));
con.close();
%>
php
CopyEdit
<?php
while($row = $result->fetch_assoc()) {
echo $row['column'];
$conn->close();
?>
• Struts is a Java framework for building web applications using the MVC (Model-View-
Controller) design pattern.
jQuery Struts
Handles DOM manipulation, AJAX calls. Handles business logic and web requests.
Lightweight. Heavyweight.
Immediate feedback. Immediate feedback with easy syntax. Validation after form submit.
• AngularJS is a JavaScript framework developed by Google used for building dynamic web
applications with two-way data binding.
• Directives are markers on HTML elements that tell AngularJS to attach a behavior.
Directive Purpose
AngularJS Node.js
Used to build dynamic web apps. Used to build server-side apps and APIs.
• EJB is used in enterprise applications needing features like transactions, security, concurrency,
and remote access.
• Web services are software systems that allow communication between different applications
over the network using standard protocols like HTTP, XML, SOAP.
• 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.
• Interceptors in Struts are objects that can process requests before and after the execution of
an Action class.
• ID Selector (CSS/HTML):
• Contexted Selector:
• Internal CSS: Good for small websites, easier management of styles in one page.
Term Meaning
Property A value associated with an object in the DOM (e.g., input.value in JavaScript).
• An HTML Form is used to collect user input and send it to the server for processing, using
tags like <form>, <input>, <textarea>, etc.
html
CopyEdit
</form>
• Three types: Ordered List (<ol>), Unordered List (<ul>), and Description List (<dl>).
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>
• 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>
• DOCTYPE declaration tells the browser which version of HTML the page is written in.
• Example:
html
CopyEdit
<!DOCTYPE html>
• Implicit objects are predefined objects available in JSP without needing to declare them.
• Examples: request, response, session, application, out, config, pageContext, page, exception.
• Examples:
Syntax example:
jsp
CopyEdit
<%@ page language="java" contentType="text/html" %>
• Examples:
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.