8.question Bank
8.question Bank
Web server:The web server on the other side is a computer program, which delivers content,
such as websites or web pages, for example, over the world wide web from a web server to your
computer.
Define internet.
The Internet is a global system of interconnected computer networks that use the standard
Internet protocol suite (TCP/IP) to link several billion devices worldwide. It is a network of
networks that consists of millions of private, public, academic, business, and government
networks of local to global scope, linked bya broad array of electronic, wireless, and optical
networking technologies.
Define HTML.
HTML is a simple web page description language, which enables document creation for the web.
HTML is the set of mark-up symbols or codes placed in a file intended for display on the web
browser page. These mark-up symbol and codes identify structural elements such as paragraphs,
heading, and lists. HTML can be used to place media (such as graphics, video, and audio) on the
Web page and describe fill-in-forms. A method is an implementation of an objects behavior.
Explain about HTTP Connection.
It is a communication channel between web browser and web server. It begins on the client side
with the browser sending a request to the web server for a document. Request Header Fields are
From
Reference
3.If_modified_since process and the by clicking on the message log hyperlink in the
actions area.
4.Pragma
5.User Agent
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.
State the use of web server logs and list the contents of a message log. (APR/MAY 2011) A
server log is a log file (or several files) automatically created and maintained by a server of
activity performed by it. A typical example is a web server log which maintains a history of page
requests. The W3C maintains a standard format (the Common Log Format) for web server log
files, but other proprietary formats exist.The message log is used by a number of processes to
provide debugging and troubleshooting information. You can view the message log from the
process monitorafter clicking on the details hyperlink for a process and the by clicking on the
message loghyperlink in the actions area.
State the uses of internet protocol. (APR/MAY 2012)
IP function: transfer data from source device to destination device
IP source software creates a packet representing the data
Header: source and destination IP addresses, length of data, etc.
Data: Data itself
Define Tags. What are the two different types of tags?
Tags signal the browser to inform about the formatting details.ie how the contentshouls be
displayed in the browser screen. Tags are enclosed between “<” and”>”
Standalone tag only start tag is present and no end tag. Example <BR>
andcontainer tag have start and end tag will be present .Example <html>….
</html>
What are the rules to define a tag?
Attributes should be placed inside start tag, appears as Name-value pairs separted by blank
spaces, Attributes should have only one value,values should be enclosed within either single(‘)
or double (“) quotes.
What is the need of using form in HTML?
Form is a typical layout on the web page by which user can interact with the web page. The
components that can be placed on the form are text box, check box, radio buttons, and push
buttonsand so on. Thus form is typically used to create an interactive Graphical User Interface.
What is the purpose of using frames in HTML?
The HTML frames allows the web designer to present the web document in multiple views. Using
multiple views one can keep the formation visible and at the same time other views can be scrolled
or replaced.
What is the need for special character in HTML?
There are some symbols that cannot be used directly in HTML document. For example <(less
than)because this symbol is also used along with the tag. Hence this is called a special symbol and
canbe denoted with the help of entity reference.
State how an unrecognized element or attribute treated by the HTML document?
If any unrecocognized element or attribute is written then the HTML document simply displays the
contents. For example <title>testing</title> will display the string “testing” on the web page. It will
not display it as a title of the web page.
What is the use of hyperlink tag in HTML?
The hyperlink tag is used to link logically with other page. Using this tag a weblink can be
specified. The <a> tag is used to specify the hyperlink in HTML.
What are the uses of hyperlink in HTML?
To logically link one page with another, use of link to enhance readability of theweb document, the
navigation from one page to another is possible.
What is BODY in HTML document?
The effects which we want in the window are mentioned with the help of tags inthe body. It is the
place where the actual data is written in html. All the changes can be viewed by changing the tags
content in the body whereas the head part is the introduction part and the body is the actual content
part.<BODY>data content</BODY>
What are style sheets?
The style sheets are the collection of styles that can be either embedded within the HTML
documents or can be externally applied. The Cascading style sheet is a markup language used to
apply the styles to HTML elements.
What is selector string? Specify any three forms of selectors.
The rule set in CSS consists of selector string which is basically an HTML element. These selectors
can be defined with the help of properties and values.
What is the use of Universal Selector?
Using the universal selector the values can be defined for all the elements in the document. It is
denoted by *.
What is generic class selector?
The generic class applied to any tag in the HTML document. And thus the values defined within
that generic selector can be applied to the corresponding tag. The class selector must be preceded by
the dot operator.
What are the various style sheets?
Inline, external, imported and embedded are the different types of style sheets.
Explain inline, embedded andexternal style sheets. Inline
If only a small piece of code has to be styled then inline style sheets can be used.
Embedded
Embedded style sheets are put between the <head></head> tags.
External
If you want to apply a style to all the pages within yourwebsite by changing just one style sheet,
then external style sheets can be used.
How will you include CSS in a website? (MAY/JUNE 2014) Inline
Inline styles are when you just insert the type of style you want inside another tag, using the style
attribute. This is usually the least useful way to use CSS.
<p style="width:100%; color:#660099; text-align:right; background-color:#ffcc00;" >
Embedded
Styles can also be placed in the document using the <style> tag. The <style>tag is usually placed in
the head section of the document, where it will apply to the whole document.
<style><!--
p { color:#009900;font-family:"comic sans ms",sans-serif; }h1 { color:#660000;font-
size:12p
</style>
External styles
Styles can also be set in an external style sheet which is linked to the page with a
<link> tag. For example the style sheet for this site is included like this:
<link rel="stylesheet" type="text/css" href="class.css" />
What is the purpose of CSS Box Model and mention its parts also.
The CSS box model is essentially a box that wraps around HTML elements, and it consists of:
margins,
borders, padding, and the actual content.The different parts are:
Margin
Border
Padding
Content
Part-B
1. Explain WWW and HTTP Protocol.
2. Discuss the structure of the HTTP request message. (NOV/DEC 2012)
3. Discuss the structure of the HTTP response message.[8] (NOV/DEC 2012)
4. Explain HTML elements in detail also State the types of lists supported by HTMLand
explain them in detail. (APR/MAY 2011)
5. Discuss the various features available in HTML to format the text with example.
i) Explain how tables can be inserted into HTML document with example.
ii)What is the significance of using forms on the web page?
6. Discuss how to create list and frame using HTML. Give Example.
7. Explain the capabilities of Web Server (APR/MAY 2013)
8. Explain about the XHTML DTD with an Example.
9. Explain the significance of XHTML with the help of a real time application. Writenecessary
code snippets (MAY/JUNE 2014)
10. Explain about Style Rule Cascading and Inheritance
11. Explain any eight CSS text properties.
Part – A
1.What is JavaScript?
JavaScript is a platform-independent, event-driven, interpreted client-side scripting language
developed by Netscape Communications Corp. and Sun Microsystems.
2.What are the primitive data types in javascript?
JavaScript supports five primitive data types: number, string, Boolean, undefined, and null. These
types are referred to as primitive typesbecause they are the basic building blocks from which more
complex types can be built. Of the five, only number, string, and Boolean are real data types in the
sense of actually storing data. Undefinedand null are types that arise under special circumstances.
3.What are the Escape Codes Supported in JavaScript?
The Escape codes supported in javascript are \b Backspace,\t Tab (horizontal),\n Linefeed
(newline),\v Tab (vertical),\f Form feed,\rCarriage return,\" Double quote \'Single quote,\\
Backslash.
4.What is JavaScript name spacing? How and where is it used?
Using global variables in JavaScript is evil and a bad practice. That being said, namespacing is used
to bundle up all your functionality using a unique name. In JavaScript, a namespace is really just an
object that you’ve attached all further methods, properties and objects. It promotes modularity and
code reuse in the application.
5.How many looping structures can you find in javascript?
If you are a programmer, you know the use of loops. It is used to run a piece of code multiple times
according to some particular condition. Javascript being a popular scripting language supports the
following loops for, while, do-while loop
6.Mention the various Java Script Object Models.
Math Object, String Object, Date Object, Boolean and Number Object, Document Object Window
Object.
7.How Scripting Language Is Differs from HTML?
HTML is used for simple web page design, HTML with FORM is used for both form design and
Reading input values from user, Scripting Language is used for Validating the given input values
weather it is correct or not, if the input value is incorrect, the user can pass an error message to
the user, Using form concept various controls like Text box, Radio Button, Command Button, Text
Area control and List box can be created.
8.What are the different types of objects in JavaScript?
Implementation
Type Example Governing Standard
Provided By
User- Programmer defined Programmer None
defined Customer or Circle
Built-in Array, Math The browser via engine its ECMA-262
JavaScript
Browser Window, Navigator The browser None (though some portions
adhere to an adhoc standard)
Document Image, The browser via W3C DOM
HTMLInputElement its DOM engine
9.Justify “JavaScript” is an event-driven programming” W3C DOM
Javascript supports event driven programming. when user clicks the mouse or hit the keys on
the keyboard or if user submits the form then these events and response to them can be handled
using javascript. Hence javascript is mainly used in web programming for validating the data
provided by the user.
10.What is the use of pop up boxes in java script?
There are three types of popup boxes used in javascript. Using these popup boxes the user can
interact with the web application.
11.What is DOM?
Document Object Model (DOM) is a set of platform independent and language neutral application
interface (API) which describes how to access and manipulate the information stored in XML,
XHTML and javascript documents.
12.Enlist any four mouse events.
The MouseEvent are-mousedown, mouseup, mouseover, mousemove, mouseout.
13.List ad various level of document object modeling.
Various levels of DOM are DOM0, Dom1, Dom2, and Dom3
14.What are they validation properties and methods?
Validation properties and methods are checkvalidity (), validaionMessage, customerror,
patternMismatch, rangeOverflow, rangeUnderflow, tooLong.
15.Define event bubbling.
Suppose, there is an element present inside another element. Then during the event handling, if
the event which is present in the inner element is handled and then the event of the outer element
is handled. This process of event handling is called event bubbling
16.How to create arrays in Javascript?We can declare an array like this Var scripts = new
Array(); We can
add elements to this array like thisscripts[0] = "PHP";
scripts[1] = "ASP"; scripts[2] = "JavaScript";
scripts[3] = "HTML";
Now our array scrips has 4 elements inside it and we can print or access them by using their
index number. Note that index number starts from 0. To get the third element of the array we
have to use the index number 2. Here is the way to get the third element of an array. document.
write (scripts[2]); We also can create an array like this var no_array = new Array(21, 22, 23,
24, 25);
17.Write a simple program in JavaScript to validate the email-id.
<!DOCTYPE html>
<html>
<head>
<script>
function validateForm() {
var x = document.forms["myForm"]["email"].value; var atpos = x.index
dotpos+2>=x.length)
{ alert("Not a valid e-mailaddress");
return false;}}
</script> </head>
<body>
<form
name="myForm"
action="demo_form.asp"
onsubmit="return
validateForm();" method="post"> Email: <input type="text" name="email">
<input type="submit" value="Submit">
</form>
</body>
</html>
18.Write short notes on JDBC.
JDBC standard is intented for people developing industrial-strength database
applications.JDBC makes java effective for developing enterprise information system.java.sql
is the JDBC package that contains classes & interfaces that enable a java program to interact
with a database.
19.Write short notes on JDBC drivers.
A JDBC driver is basically an implementation of the function calls specified in the JDBC API
for a particular vendor’s RDBMS. Hence, a java program with JDBC function calls can access
any RDBMS that has a JDBC driver available. A driver manager is used to keep track of all the
installed drivers on the system. The operations of driver manager are getDriver, registerDriver,
deregisterDriver.
20.What are the advantages of servlet over CGI?
• Performance is significantly better, servlet execute within the address space
• of aweb server.
• Servlets are platform independent
• The java security manager on the server enforces a set of restrictions to protect
• the resources on a server machine.
• The full functionality of java class libraries is available to a servlet.
Part - B
1.How to write function using Java Script? Give Example.
2.Explain sub classes and super classes in Javascript.
3.Discuss Javascript objects in detail with suitable examples.
(NOV/DEC 2012,MAY/JUNE 2014)
4.Discuss about Javascript debugging. Explain how local and global
functions can bewritten using java script (MAY/JUNE 2012)
5.Explain the way in which java script handles arrays with example. (MAY/JUNE 2012)
6.i) Write a Java script to find the factorial of the given number.
ii) Write a Java script to find the prime number between 1 and 100.
7.Write a servlet program which displays the different content each time the user visits thepage
8.Write a Java script program to create Popup box, alert and confirm box.
9.Write a Java script program to print the numbers from 0 to 50. b. Write a Java Script program to
create table.
10.Write a Java script program to create user registration form.
11.i) Explain any two validation function in java script.(4)
ii)Write a script to demonstrate the use of Date object.(6)
iii) Write a java script program to generate Fibonacci series using do while loop.(6)
12.i) Explain JavaScript & document object model (DOM ) with example.(8)
ii) Explain in details the JDBC CONNECTIVITY with example program.(8)
Explain the JDBC database access in detail. Write a java servlet to conduct online
examination. (APR/MAY 2013)
Part – A
1.Write down the methods of servlet interface
void destroy() –called when the servlet is unloaded.
ServletConfig getServletConfig() –returns a ServletConfig object that Contains any initialization
parameters. String get ServletInfo() – returns a string describing the servlet. Void
init(ServletConfigsc)throws ServletException –called when the servlet is initialized .
Initialization parameters for servlet can be obtained from sc. An unavailable exception should be
thrown if the servlet is not initialized.
Void Service(ServletRequest req,ServletResponse res) throws ServletException, IOException-
Called to process a request from a client. The request from the client can be read from req.
response to the client can be written to res. An exception is generated if a servlet or IO problem
occurs.
2.What is the difference between CGI and servlets?
• Performance is significantly better, servlet execute within the
• address space of aweb server.
• Servlets are platform independent
• The java security manager on the server enforces a set of
• restrictions to protectthe resources on a server machine.
• The full functionality of java class libraries is available to a servlet.
3.Define Servlet Life Cycle?
• init( ) method - invoked when the servlet is first loaded into memory
• service( ) - called for each HTTP request (for processing)
• destroy( ) - unloads the servlet from its memory.
4.What is JSP?
JavaServer Pages (JSP) is a technology for developing web pages that support dynamic content
which helps developers insert java code in HTML pages by making use of special JSP tags, most of
which start with <% and end with %>.
5.What are advantages of using JSP?
a. Performance is significantly better because JSP allows embedding Dynamic
Elements in HTML Pages itself.
b. JSP are always compiled before it's processed by the server unlike CGI/Perl which
requires the server to load an interpreter and the target script each time the page is requested.
6.Explain lifecycle of a JSP.
• Compilation
• Initialization
• Execution
• Cleanup
7.What are JSP actions?
JSP actions use constructs in XML syntax to control the behavior of the servlet engine. You can
dynamically insert a file, reuse JavaBeans components, forward the user to another page, or
generate HTML for the Java plugin.
8.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 there's no wasted time in setting up and tearing down the process.
9. What are Applets?
A program designed to be executed from within another application. Unlike an application,
applets cannot be executed directly from the operating system. With the growing popularity of
OLE (object linking and embedding), applets are becoming more prevalent. A well-designed
applet can be invoked from many different applications. Web browsers, who are often equipped
with Java virtual machines, can interpret applets from Web servers. Because applets are small in
files size, cross-platform compatible, and highly secure (can‟t be used to access users' hard
drives), they are ideal for small Internet applications accessible from a browser.
10.What do you mean by Server-side?
Occurring on the server side of a client-server system. 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.
11.Write a note on Environment variables.
In CGI, the server prepares the environment variables before it launches the CGI script. These
represent the current state of the server that is asking for the information. The environment variables
are not set from the command line but are created on the fly, and lasts only until that particular
script is finished. Each script gets its own unique set of variables and multiple scripts can be
executed at once, each in its own environment.
12. What are STDIN and STDOUT?
These are mnemonics for standard input and standard output, two predefined stream file handles.
Each process already inherits these two handles already open. From the script's point of view,
STDIN is what comes from the browser via the server when the post method is used, and the
STDOUT is where it writes its output back to the browser. The script picks up the environment
variables and reads STDIN as appropriate. It then does whatever it was designed to do and writes its
output to STDOUT.
13. 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
howto 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.
14.Explain about Session tracking.
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.
15. Define packet switched networks.
Packet switched network means that data traveling on the network is broken into chunks called
packets and each packet is handled separately.
16. Define socket.
The socket is a software abstraction used to represent the terminals of a connection between two
machines or processes.
17.Write a note on Connect Exception.
This exception is raised when a connection is refused at the remote host. (ie, no process is listening
on that port).
18. What is a multicast socket?
Multicasting sends data from one host to many different hosts, which are in the multicast group.
19. What is multicast address and the range of address? A multicast address is the address of a
group of hosts called a multicast group. Multicast addresses are IP addresses in the range 224.0.0.0
to 239.255.255.255
20. What are the different types of IP addresses?
Unicast address: It is used for transmitting a message to single destination node Multicast address:
It delivers a message to a group of destination nodes, which are necessarily in the same sub
network. Broadcast address: It transmits a message to all nodes in a sub network.
Part - B
1.What is a servlet? Explain briefly the Servlet life cycle and Servlet HTTP package?
2.List out the classes and interfaces available in javax.servlet.http package?
3.Write short notes on the following servlet classes
4.Write a servlet program which displays the different image each time the user visitsthe page and
the images are links
5.Explain in detail about Servlet Database Connectivity with an example of Student database.
6.Explain in detail about JSP with an example of current date and simple message.
7.Discuss in detail about Action elements in JSP with an example of display current timeand color.
8.Explain about JSP object in detail.