MRCET
Dept. of CSE
pg. 1
WEB TECHNOLOGIES
NO!.Java and JavaScript are two completely different languages in both concept and design. Java
(developed by Sun Microsystems) is a powerful and much more complex programming language
- in the same category as C and C++.
8. What is DOM? What are the 2 traditional ways of assigning event handlers in DOM.
The Document Object Model (DOM) is the model that describes how all elements in an HTML
page, like input fields, images, paragraphs etc., are related to the topmost structure: the document
itself. By calling the element by its proper DOM name, we can influence it.
The 2 traditional ways of assigning event handlers in DOM
1) Via HTML, using attributes
2) Via scripting
9. Define CGI -Common Gateway Interface.
CGI is a specification for transferring information between a World Wide Web server and a CGI
program. ACGI program is any program designed to accept and return data that conforms to the
CGI specification. The program could be written in. any programming language, including C,
Perl, Java, or Visual Basic.
10. What are Servlets?
A small program that runs on a server, the term usually refers to a Java applet that runs within a
Web server environment. This is analogous to a Java applet that runs within a Web browser
environment. Java servlets are becoming increasingly popular as an alternative to CGI programs.
The biggest difference between the two is that a Java applet is persistent. This means that once it
is started, it stays in memory and can fulfill multiple requests. In contrast, a CGI program
disappears once it has fulfilled a request. The persistence of Java applets makes them faster
because theres no wasted time in setting up and tearing down the process
11. Compare Servlet with CGI
Servlets have several advantages over CGI:
A Servlet does not run in a separate process. This removes the overhead of creating a new
process for each request.
A Servlet stays in memory between requests. A CGI program (and probably also an extensive
runtime system or interpreter) needs to be loaded and started for each CGI request.
There is only a single instance which answers all requests concurrently. This saves memory and
allows a Servlet to easily manage persistent data.
12. List the advantages of CGI scripting?
I. CGI programs are relatively safe to run.
2. A CGI program can crash without damaging the server, since it only has limited access to the
server.
3. Reduces the burden of server
a. Sends prepared messages / mails e customer reply
b. Capability to process forms and prepares output based on form input.
c. Hit counts / Page counters.
13. What do you mean by Server-side?
MRCET
Dept. of CSE
pg. 2
WEB TECHNOLOGIES
Occurring on the server side of a client-server systems. For example, on the World Wide Web,
CGI scripts are server-side applications because they run on the Web server. In contrast,
JavaScript scripts are client-side because they are executed by your browser (the client). Java
applets can be either server-side or client- side depending on which computer (the server or the
client) executes them.
14. What are the sequences of steps for each HTTP request from a client to the server?
1. Making the connection
2. Making a request
3. The response
4. Closing the connection
15. Define URI, URL, URN.
1. URI (Uniform Resource Identifier): It identifies an object on the Internet.
2. URL (Uniform Resource Locator): It is a specification for identifying an object such as a file,
newsgroup, CGI program or e-mail address by indicating the exact location on the internet.
3. URN (Uniform Resource Name): It is a method for referencing an object without declaring the
full path to the object.
16. What are the two commonly used Request methods?
The request methods tell the script how it was invoked. Based on this information, the script
decides how to act. The request method is passed to the script using environment variable called
REQUEST- METHOD. The two most common request methods used are GET and POST. The
main differences between GET and POST is
$_GET is an array of variables passed to the current script via the URL parameters. Easy to
hack the data as data is stored in browser history, Only ASCII data can be sent and Data is not
secret as other people can see the data in browser history
$_POST is an array of variables passed to the current script via the HTTP POST method.
Difficult to hack, Any type of data can be sent including binary data and Data is secret as not
stored in history
17. What are Style Sheets? List down font characteristics permitted in style sheets.
Style sheets are collections of style information that are applied to plain text. Style information
includes font attributes such as type size, special effects (bold, italic, underline), color and
alignment. Style sheets also provide broader formatting instructions by specifying values for
quantities such as line spacing and left and right margins.
Font characteristics: font-family, font-size, font-weight, font-style and font-variant.
18. Define cascading.
Cascading refers to a certain set of rules that browsers use, in cascading order, to determine how
to use the style information. Such a set of rules is useful in the event of conflicting style
information because the rules would give the browser a way to determine which style is given
precedence.
19. Explain about Session tracking.
MRCET
Dept. of CSE
pg. 3
WEB TECHNOLOGIES
A session is basically a conversation between a browser and a server. All the above technologies
can save information for the current session for a particular user visiting a site. The session is
important, as H1TP is a stateless protocol. This means that the connection between web server
and a web browser is not automatically maintained, and that the state of a web session is not
saved.
20. What is a Session & Cookies? What are the main differences between cookie & session?
A collection of HTTP requests all associated with a single session ID is known as a session. Each
HTTP request is examined by the server to see if it contains a special identifier known as a
session ID.
A cookie is a Name-value pair that a web server sends to a client machine as part of an HTTP
response, specifically through the Set-Cookie header field. Browsers will store the cookie pairs
found in the response in a file on the client machine.
Differences between cookie and session:
The main difference between a session and a cookie is that session data is stored on the server,
whereas cookies store data in the visitor's browser. Sessions are more secure than cookies as it is
stored in server. Cookie can be turn off from browser.
21. Define Java Server Pages and What is the use of JSP? What are the three categories of
JSP element types?
It can be defined as one instantiation of a class of related technologies that facilitate separate
development of a websites presentation and logic. The key contribution of these technologies is
to embed program code related to presentation within a document. JSP are used enable web
application programmers to create dynamic content by reusing predefined components and by
interacting with components using server side scripting.
JSP element types; 1.Scripting
2.Directive
3.Action
Dept. of CSE
pg. 4
WEB TECHNOLOGIES
A simple mechanism to call java methods from within a JSP document.JSP provides such a
mechanism through its support for JavaBeans classes. If a java class is written so as to conform
to certain aspects of the JavaBeans Specification, the certain methods of this class can be called
from a JSP document.
24. Define XML Schema.
XML schema defines the structure of XML documents. The purpose of an XML Schema is to
define the legal building blocks of an XML document, just like a DTD. A key contribution of
XML schema is its definition of a collection of standard data types. Each data type definition
includes a specification of the range of values that can be represented by the data type and details
on how to represent those values as strings.
Here are some reasons:
XML Schemas are extensible to future additions
XML Schemas are richer and more powerful than DTDs
XML Schemas are written in XML
25. What is XSL Programming?
XSL (XML Stylesheet) Programming is the Next Generation of the CSS (Cascading Style Sheet
Programming). In CSS, users can use certain style tags which the browsers can understand and
are predefined by W3 consortium. XSL takes ths to one step ahead and users can define any tags
in the XML file. XML sheets can help in showing the same data in different formats.
<?xml-stylesheet href="doc.xsl" type="text/xsl"?>
26. What is a Scriplet?
A Scriplet is a fragment of java code that is embedded within the JSP document. Scriptlets enable
you to create small, reusable web applications that can be used in any web page. Scriptlets are
created using HTML, scripting and Dynamic HTML. To include them in an HTML document
use the <OBJECT> tag.
27 . Explain HTTP Request and Response Message?
HTTP Request Message
The client initiates an HTTP session by opening a TCP connection to the HTTP server with
which it wishes to communicate. It then sends request messages to the server, each of which
specifies a particular type of action that the user of the HTTP client would like the server to take.
Requests can be generated either by specific user action (such as clicking a hyperlink in a Web
browser) or indirectly as a result of a prior action (such as a reference to an inline image in an
HTML document leading to a request for that image.)
HTTP requests use a message format that is based on the generic message format described in
the preceding topic, but specific to the needs of requests. The structure of this format is as
follows :
<request-line>
<general-headers>
<request-headers>
<entity-headers>
<empty-line>[<message-body>][<message-trailers>]
MRCET
Dept. of CSE
pg. 5
WEB TECHNOLOGIES
Dept. of CSE
pg. 6
WEB TECHNOLOGIES
XML parser. XML parsers normally parse all the text in an XML document. When an XML
element is parsed, the text between the XML tags is also parsed:
<message>This text is also parsed</message>
Keyword PCDATA specifies that the element must contain parsable character data
that is , any text except the characters less-than (<) , greater-than (>) , ampersand (&),
quote(') and double quote (") .
Keyword PCDATA specifies that the element must contain parsable character data that
is, any text except the characters less-than ( < ) , greater-than ( > ), ampersand ( & ),
quote( ' ) and double quote ( " ).
32. What is meant by Scripting Language? Explain any one of the Scripting Languages?
A scripting language is a form of programming language that is usually interpreted rather
than compiled. Conventional programs are converted permanently into executable files before
they are run. In contrast, programs in scripting language are interpreted one command at a time.
Types of scripting languages
Specialized scripting languages include:
Perl (Practical Extraction and Report Language), Hypertalk, JavaScript & VBScript
Give the elements to write a script?`
<script type=text/javascript> write script here </script>
33. Explain about <TABLE> &<FRAME> tags in Detail?
Code for Basic HTML Table
<table>
Create a table cells.
<tr><th>-----------</th></tr><!----Table
i) Header cell
Head>
ii) Data cell
<tr><td>---------</td></tr> <!---Row1--->
Table Alignment
<tr><td>---------</td></tr> <!---Row2-->
i) Aligning the Entiere Table
------------------------ii) Alignment within a row.
<tr><td>---------</td></tr> <!---Rowm-->
ii) Alignment within a cell.
</ table >
MRCET
Dept. of CSE
pg. 7