WT - Question Bank - Unit Test
WT - Question Bank - Unit Test
->
It didn’t support audio and video It supports audio and video
without the use of flash player support. controls with the use of <audio>
and <video> tags.
It does not allow drag and drop effects. It allows drag and drop effects.
Not possible to draw shapes like circle, HTML5 allows to draw shapes
rectangle, triangle etc. like circle, rectangle, triangle etc.
Elements like nav, header were not New element for web structure
present. like nav, header, footer etc.
Attributes like charset, async and ping Attributes of charset, async and
are absent in HTML. ping are a part of HTML 5.
What do you mean by CSS? What are the different ways to create CSS?
-> Cascading Style Sheets (CSS) is a stylesheet language used to describe
the presentation of a document written in HTML or XML (including XML
dialects such as SVG, MathML or XHTML). CSS describes how elements
should be rendered on screen, on paper, in speech, or on other media.
Define the term. 1. Website 2. Web Page 3. Web server 4. URL and Home
Page.
->
1. Website: a group of World Wide Web pages usually containing links to
each other and made available online by an individual, company, or
organization.
2. Web Page : A web page (or webpage) is a hypertext document provided
by a website and displayed to a user in a web browser.
3. Web Server : The basic objective of the web server is to store, process
and deliver web pages to the users. This intercommunication is done using
Hypertext Transfer Protocol (HTTP).
4. URL : A Uniform Resource Locator (URL), colloquially termed a web
address,[1] is a reference to a web resource that specifies its location on
a computer network and a mechanism for retrieving it
5. Home Page:A home page (or homepage) is the main web page of
a website.
6. The term also refers to one or more pages always shown in a web
browser when the application starts up. In this case, it is also known as
the start page or startup page.
Functional Style
Platform Independent
Prototype-based
Interpreted Language
Async Processing
Client-Side Validation
Data
Description Example
Types
represents textual
String 'hello', "hello world!" etc
data
an integer or a
Number 3, 3.234, 3e-2 etc.
floating-point number
an integer with 900719925124740999n ,
BigInt
arbitrary precision 1n etc.
key-value pairs of
Object let student = { };
collection of data
represents textual
String 'hello', "hello world!" etc
data
an integer or a
Number 3, 3.234, 3e-2 etc.
floating-point number
key-value pairs of
Object let student = { };
collection of data
What is the purpose of DOM node tree? Create DOM node tree for
simple HTML page.
->The HTML DOM Node Tree (Document Tree)
The HTML DOM views a HTML document as a tree-structure. The
tree structure is called a node-tree.
All nodes can be accessed through the tree. Their contents can be
modified or deleted, and new elements can be created.
The node tree below shows the set of nodes, and the connections
between them. The tree starts at the root node and branches out to the
text nodes at the lowest level of the tree:
Explain Servlet lifecycle with example program.
->The servlet life cycle contains five phases:
1) load a servlet class-
The class Classloader is responsible to load servlet class.ClassLoader
object is designed to load a class just once. It is loaded, when the first
request for the servlet is received by the web container.
2) Servlet instance is created-
At the time code for a servlet is loaded, the server creates a single instance.
That single instance handles every request made of the servlet. The servlet
object is created once in the entire servlet life cycle.
3) init() method-
init() method is called after creating the servlet instance. It is called only
once in the entire lifecycle. It is used to initialize the servlet. Init() is
guaranteed to be called and completed before the servlet handles its
first request. During init() method a servlet may want to read its
initialization(init) parameter.
4) service() method-
Service() method is called every time when a request for a servlet is
received.
Service() method is used to handle requests as appropriate for the servlet.
The service() method accepts 2 parameters: a request object and a response
object.
It overrides doGet() and doPost() method.
doGet() method - doGet() method is used to handle the get request.
doPost() method - doPost() method is used to handle the Post request.
Read more about HTTP Request method:
HTTP Request methods - doGet(), doPost(), doHead(), doDelete() etc.
5) Destroy() method-
This method is called only once in the entire life cycle of a servlet. The
servlet calls the destroy() method after the servlet has been taken out of
service and all pending requests have completed or timed out.
1. Client
2. Web container
3. Request
4. Response
The servlet container is connected to the web server that receives Http
Requests from client on a certain port. When client sends a request to web
server, the servlet container
creates HttpServletRequest and HttpServletResponse objects and passes
them as an argument to the servlet service() method.
The response object allows you to format and send the response back to the
client.
The servlet container creates an HttpServletRequest object and passes it as
an argument to the servlet's service methods (doGet, doPost, etc).
Cookies
A web server can send a hidden HTML form field along with a unique
session ID as follows −
<input type = "hidden" name = "sessionid" value = "12345">
This entry means that, when the form is submitted, the specified name and
value are automatically included in the GET or POST data. Each time when
web browser sends request back, then session_id value can be used to keep
the track of different web browsers.
URL Rewriting
You can append some extra data on the end of each URL that identifies the
session, and the server can associate that session identifier with data it has
stored about that session.
For example, with http://tutorialspoint.com/file.htm;sessionid = 12345, the
session identifier is attached as sessionid = 12345 which can be accessed at
the web server to identify the client.
Apart from the above mentioned three ways, servlet provides HttpSession
Interface which provides a way to identify a user across more than one
page request or visit to a Web site and to store information about that user.
The servlet container uses this interface to create a session between an
HTTP client and an HTTP server. The session persists for a specified time
period, across more than one connection or page request from the user.
You would get HttpSession object by calling the public
method getSession() of HttpServletRequest, as below −
HttpSession session = request.getSession();