Question Bank
Question Bank
HTML stands for Hyper Text Markup Language .HTML describes the structure of
Web pages using markup. JavaScript is a dynamic computer programming
language. It is lightweight and most commonly used as a part of web pages.
4-Define a web page and a website ?
A web page is a document that is suitable for the World Wide Web and web browsers. A
set of related web pages located under a single domain name and published on at least one
web server. For example www.tevta.gop.pk
5-Define WWW & Protocol?
The World Wide Web (WWW) is combination of all resources and users on the Internet that
are using the Hypertext Transfer Protocol (HTTP).
When computers communicate with each other, there needs to be a common set of rules
and instructions that each computer follows. A specific set of communication rules is called
a protocol.
6-How HTTP works?
HTTP is a request response protocol to communicate asynchronously between client and
server. Mostly in HTTP a browser acts as a client and a web-server. A client (browser)
submits an HTTP request to the server; then the server returns a response to
the client. The response contains status information about the request and may
also contain the requested content
7-Write HTTP methods/requests?
GET ,POST ,PUT ,HEAD ,DELETE , PATCH ,OPTIONS
8-Define server side programming? write any two languages.
It is the program that runs on server dealing with the generation of content of web page.
Languages are : PHP ,C++
9-Define client side programming? Write any two languages.
It is the program that runs on the client machine (browser) and deals with the user
interface and any other processing that can happen on client machine like reading/writing
cookies.
Languages are: Javascript, HTML, CSS
10-Define CSS ?
14- Write the purpose of client side programming/ why we use client side
programming/advantages?
Interact with temporary storage
Make interactive web pages
Interact with local storage
Sending request for data to server
Send request to server
15- Write the purpose of server side programming/why we use server side
programming/advantages?
Querying the database
Operations over databases
Access/Write a file on server.
Interact with other servers.
Structure web applications
Long Questions:
1-what is HTTP Basics? How HTTP works ?write down its methods/requests?
2-Describe server side programming and languages used for server side programming?
3-Describe client side programming and languages used for client side programming?
4-what is web application? describe web application layers ?
Chapter#2
Long Questions:
1-Describe web application directory structure?
Chapter#3
1-HTML document consists on how much parts? briefly explain
An HTML document has two main parts: the head and the body. The HEAD of an HTML
document is where information (which might be ignored by some Web browsers), such as
the document's title, can be placed.
The BODY of an HTML document is where all the information you wish to view must
appear. Such as <p>,<img>
2-write simple “ Hello world” example in HTML?
<html>
<head>
<title>
A Simple HTML Document </title>
</head>
<body>
<p>This is a very simple HTML document</p>
<p>”Hello world” </p>
</body> </html>
External style sheets can be referenced with a full URL or with a path relative to the current
web page.
Example<link rel="stylesheet" href="https://www.w3schools.com/html/styles.css">
CSS is used to define styles for your web pages, including the design, layout and variations
in display for different devices and screen sizes.
The HTML tables allow web authors to arrange data like text, images, links, other tables,
etc. into rows and columns of cells.
HTML Forms are required, when you want to collect some data from the site
visitor. For example, during user registration you would like to collect
information such as name, email address, credit card, etc .
p {
border: 1px solid powderblue;
}
Web pages have two basic containers: the head and the body:
Long Questions:
1-Describe HTML document structure with example? Write some important HTML tags
used in HTML document?
Chapter#4
Long Questions:
1-Describe How to apply styles on elements using javascript?
2-Describe JQuery & JQuery Selectors in detail?
3-Describe How to apply validation on HTML Form using javascript?
4-what is javascript?what can javascript do ?how to hide and show elements
using JS?
Chapter#5
1-Define Servlet?
Servlet is a technology which is used to create a web application. It uses java language.
Servlet is an API that provides many interfaces and classes including documentation.
2-write any two advantages of servlet?
Servlet enables easy portability across Web Servers.
Servlet can communicate with different servlet and servers.
Long Questions:
1-Define Servlet and Describe Servlet life cycle?
2-Describe servlet advantages and its Types?
3-Write Basic “HELLO WORLD” servlet?
Chapter#6
1. Translation
2. Compilation
3. Loading
4. Instantiation
5. Initialization
6. RequestProcessing
7. Destruction
Long Questions:
1- Describe JSP life cycle?
2- Describe Elements of JSP?
3- Describe Standard actions of JSP?
Chapter#7
1. Cookies
2. Hidden form field
3. URL Rewriting
4. HttpSession
2-Define a Cookie?
Cookies are small pieces of information that are sent in response from the web server to
the client. Cookies are the simplest technique used for storing client state.
Cookies are stored on client's computer. They have a lifespan and are destroyed by the
client browser at the end of that lifespan.
3-Define a Session?
HttpSession object is used to store entire session with a specific client. We can store,
retrieve and remove attribute from HttpSession object. Any servlet can have access
to HttpSession object throughout the getSession() method of
the HttpServletRequest object
If the client has disabled cookies in the browser then session management using cookie
wont work. In that case URL Rewriting can be used as a backup. URL rewriting will always
work.
In URL rewriting, a token(parameter) is added at the end of the URL. The token consist of
name/value pair seperated by an equal(=) sign.
Long Questions:
1-Describe Session Management and its techniques?
2-Describe Hidden form field for session management?
3-Describe URL rewriting for session management?
Chapter#8
1-what is API?
API (Application programming interface) is a document that contains a description of all
the features of a product or software. It represents classes and interfaces that software
programs can follow to communicate with each other.
2-What is JDBC?
JDBC stands for Java Database Connectivity. JDBC is a Java API to connect and execute the
query with the database. It is a part of JavaSE (Java Standard Edition). JDBC API uses JDBC
drivers to connect with the database.
3-Define execute query method?
This method is used to execute statements that returns tabular data (example select). It
returns an object of the class ResultSet.
5-Define execute update method?
The executeUpdate() method returns the number of rows affected by the SQL
statement (an INSERT typically affects one row, but an UPDATE or DELETE statement can
affect more).
Long Questions:
1-Describe the connection to the database in JDBC programming and how to access
database?
Chapter#9
1-what is a custom Tag?
A custom tag is a user-defined JSP language element. When a JSP page containing a custom
tag is translated into a servlet, the tag is converted to operations on a tag handler.
2-what is custom Tag handlers?
When a JSP page containing a custom tag is translated into a servlet, the tag is converted to
operations on an object called a tag handler.
3-write Tag handler example?
package com.myexamcloud.taghandler;
import javax.servlet.jsp.tagext.*;
import javax.servlet.jsp.*;
import java.io.*;
public class UserProfileTag extends SimpleTagSupport {
public void doTag() throws JspException, IOException {
JspWriter out = getJspContext().getOut();
// Logic to display logged in user profile details here
}
}
Long Questions:
1-what is custom tag? describe customize tag behaviour with attributes?
2-Describe Tag handler with example?
Chapter#10
JSF core
JSF html
JSF composite
JSF ui
JSTL core
JSTL functions
Long Questions:
1-what is JSF ?Describe JSF Life cycle?
2-what is event handling?describe some event handlers?
3-Describe JSF Tag Libraries?