Internet Programming
Internet Programming
Web 2.0: Basics – RIA Rich Internet Applications – Collboration Tools – Understanding
Web sites and Web Servers: Understanding Internet – Difference between websites and
web server – Internet technologies Overview – Understanding the difference between
internet and intranet; HTML and CSS: HTML 5.0, XHTML, CSS 3.
PART – A
5. Define RIA,
Rich Internet applications (RIA) are web applications that follow a standard software
development model with rich controls that include powerful data and multimedia capability
allowing us to present a rich set of information in an attractive interface.
Example: www.amazon.com, www.annauniv.edu
Collaboration Tools are computing systems that include features designed to facilitate work that
involves more than one person over internet.
16. Give the difference between Internet and Intranet. (NOV/DEC 2015)
Internet Intranet
Internet is network of Computers which is
Intranet is network of Computers designed for
open for all. a specific group of users.
Internet itself contains a large number of
Intranet can be accessed from Internet but with
intranets. restrictions.
Unlimited number of users. Limited number of Users.
Visitors traffic is unlimited. Limited visitors traffic.
Contains unlimited source of information.
Contains only specific group purpose
information.
Collection of various LANs, WANs and Mostly any of LAN or MAN or WAN.
MANs.
17. Define Protocol and list various types of protocols.(MAY/JUNE 2013)
Protocol is a set of rules and regulations which should be obeyed by both sender and
receiver for data communication.
TCP/IP - Transmission Control Protocol/Internet Protocol – Connection Oriented
Protocol
HTTP – Hypertext Transfer Protocol – Connection Oriented Protocol
FTP – File Transfer Protocol - Connection Oriented Protocol
POP3 – Post Office Protocol – Connection Oriented Protocol
SMTP – Simple Mail Transfer Protocol –
Telnet Protocol – Used in Remote Login System
UDP – User Datagram Protocol- Connectionless Protocol
Note: POP3 and SMTP protocols are used only in email-generation.
34. Mention the need for Cascading Style Sheets. (April / May 2011)
Give some advantages of using CSS. (Nov / Dec 2013)
(1) CSS allows the separation between the information contained in a document and its
presentation.
(2) Any change in the presentation can be made without disturbing the information of the
document.
(3) CSS allows developers to give the consistent appearance to all elements of the web page.
35. Give the syntax of a CSS rule. (Nov / Dec 2011, May / June 2012)
A CSS style sheet consists of one or more style rules called rulesets.
Each rule set consists of two parts:
1 Selector string 2 Declaration block
declarations
Property names
P{ font-size : x-large
Background-color : yellow
Selector String
Declaration block
36. What is Selector Strings? Explain its types.
The selector string indicates the elements to which the rule should apply, and each
declaration within the declaration block specifies a value for one style property of those
elements.
Specific elements by id
o #id1,#id2 {font-style: italic}
o This can be used as follows in html program
o <h1 id="id1"> About Panimalar </h1>
o <h2 id="id2"> Welcome </h2>
Specific element by class selector
o /* class Selector */
o .class1 {font-variant: Big-caps}
This can be used as follows in html program
o <p id="id1" class ="class1"> Panimalar Engineering College </p>
39. List the different <style> tag color and background attributes.
Attributes Values
Color Sets an element’s text-color- a color name or a color code
Background- Specifies the color in an element’s background. A color name or a color
color code.
Background- Sets the background image. A URL or none.
image
Background- Within the background image specified, sets up how the image repeats
repeat throughout the page. Repeat-x (repeats horizontally), repeat-y(repeats
vertically), repeat(both), no-repeat.
Attributes Values
Border-style Solid, double, groove, ridge,
inset, outset
Border-color A color name or color code
Border-width Thin, medium thick or length
Border-top- Thin, medium thick or length
width
Border-bottom- Thin, medium thick or length
width
Border-left- Thin, medium thick or length
width
Border-right- Thin, medium thick or length
width
Border-top Specifies width, color and
style
Border-bottom Specifies width, color and
style
Border-left Specifies width, color and
style
Border-right Specifies width, color and
style
Border Sets all the properties at once
42. List the different <style> tag Margin attributes.
Attributes Values
Margin-top Percent, length or auto
Margin-bottom Percent, length or auto
Margin-left Percent, length or auto
Margin-right Percent, length or auto
Margin Percent, length or auto
Following is a list of CSS properties that were not defined in the CSS2.1 specification.
animation font-synthesis
background-clip font-kerning
background-origin font-variant-caps
background-size hanging-punctuation
border-radius hyphens
border-image icon
box-decoration-break image-resolution
box-shadow image-orientation
box-sizing line-break
columns object-fit
clear-after object-position
flex opacity
font-stretch outline-offset
font-size-adjust overflow-wrap / word-wrap
backface-visibility text-emphasis
perspective text-justify
perspective-origin text-orientation
pointer-events (for HTML) text-overflow
resize transform
tab-size transform-style
text-align-last text-shadow
text-decoration-line transition
text-decoration-skip word-break
text-decoration-position word-spacing
text-decoration-style writing-mode
PART – B
PART – A
1. What is JavaScript?
JavaScript is a client-side scripting language which is to develop dynamic
and interactive web pages. It facilitates a programmer to design programs that
enhance the functionality and appearance of web pages.It is not an Object Oriented
Language but it is an object based language.
</script>
</head>
<body> Hello, User! </body>
</html>
</script>
</head>
<body> Hello, User! </body>
</html>
Example:
var name = window.prompt(“Please Enter your name:”,”XXX”);
7. List out the java script built in Objects. (MAY / JUNE 2012)
The global Object (window)
String
Number
Boolean
Date
Math
Array
12. List some Intrinsic Event Attributes. (April / May 2011, Nov / Dec 2013)
16. What are the common HTTP request methods used for request-response
between browser and server?
Method Description
GET Requests data from a specified resource
POST Submits data to be processed to a specified resource
HEAD Same as GET but returns only HTTP headers and no document body
PUT Uploads a representation of the specified URI
DELETE Deletes the specified resource
OPTIONS Returns the HTTP methods that the server supports
CONNECT Converts the request connection to a transparent TCP/IP tunnel
21. What are the different techniques used for handling sessions?
Cookies
Hidden Form Field
URL Rewriting
HttpSession
Writing alias name in <url-pattern> tag of Writing alias name in <url-pattern> tag
10.
web.xml is optional in JSP. of web.xml is mandatory in Servlets
PART – B
1. Write a JavaScript program to add two integers. Get the input from the user and
display the result in pop-up box.
2. Explain about DOM Nodes and Tress.
3. Write JavaScript to find sum of first n even numbers and display the result. Get the value of
‘n’ from user. (8) (May / June 2013)
4. Write JavaScript to find factorial of a given number. (8)
5. Describe how do you use regular expression on java script for form validation? Develop a
complete application that would include functions to validate the user data.
(12) (May / June 2014)
6. Explain in detail about how the exceptions can be handled in JavaScript.
7. Explain about java script Built-in Objects. (May / June 2014)
8. Explain DOM Model. (NOV/DEC 2015)
9. Explain Document Tree with an example. (8) (May / June 2011, May / June 2012)
10. Explain the DOM Event handling with suitable example. (8)
(May / June 2011, Nov / Dec 2011, May / June 2012)
11. Discuss about the architecture and life cycle of a servlet with example. (16)
(Nov / Dec 2012, May / June 2013, Nov / Dec 2013)
12. What is Session? Explain how client state is maintained using session and also
explain about session tracking and session management using an example.(16)
(Nov / Dec 2011)
13. Write a servlet to illustrate the principles of Cookies and explain. (16)
(May / June 2013, May / June 2014)
14. Explain in detail with an example the dynamic content generation by a servlet. (8)
(May / June 2012, May / June 2014)
15. What is JDBC? What is the use of it? Write and explain steps to connect a Java application
to the DB with sample program. (NOV/DEC 2015)
16. Write a Java servlet to display net salary of employee. Use JDBC connectivity to get
employee details from data base. (16) (May / June 2013)
17. Explain the following with an example:
a. JSP and Servlet b. Running JSP Application.
18. Write a client server JSP program to find simple interest and display the result in the client.
(10) (May / June 2013)
19. Explain in detail about JSTL with necessary examples.
20. Using HTML and JSP, design a scientific calculator. (NOV/DEC 2015)
PART - A
1. What is PHP?
Hypertext Preprocessor is an acronym for PHP. PHP is an open-source server
scripting language, and a powerful tool for creating dynamic and interactive Web pages. PHP is
a widely-used, free, and efficient alternative to competitors such as Microsoft's ASP.
<?php
echo "Hello World!";
?>
</body>
</html>
In PHP, a variable starts with the $ sign, followed by the name of the variable:
Example:
<?php
$txt = "Hello world!";
$x = 5;
$y = 10.5;
?>
<?php
function addFunction($num1, $num2)
{
$sum = $num1 + $num2;
echo "Sum of the two numbers is : $sum";
}
addFunction(10, 20);
?>
</body>
</html>
Output:
Sum of the two numbers is : 30
PHP provided setcookie() function to set a cookie. This function requires upto six
arguments and should be called before <html> tag. For each cookie this function has to be
called separately.
Example:
<?php
setcookie("name", "John Watkin", time()+3600, "/","", 0);
setcookie("age", "36", time()+3600, "/", "", 0);
?>
17. What are the two sets of regular expressions offered by PHP?
PHP offers functions specific to two sets of regular expression functions:
POSIX extended Regular Expressions
PERL compatible Regular Expressions
24. What do you mean by XML declaration? Give an example. (MAY/JUNE 2013)
The XML declaration is a processing instruction that identifies the document as being
XML. All XML documents should begin with an XML declaration.
For example,
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
25. What is meant by a XML namespace? (April / May 2011, 2014, Nov / Dec 2012, 2013)
An XML namespace is a collection of element and attribute names. XML namespace
provide a means for document authors to unambiguously refer to elements with the same
name (i.e., prevent collisions).
Example:
<subject>Geometry</subject> // data for student from school
and
<subject>Cardiology</subject> // data for student from medicine
Both the markup uses the element “subject” to markup data. Namespace can differentiate
these two “subject” elements:
<highschool:subject>Geometry</highschool:subject>
and <medicalschool:subject>Cardiology</medicalschool:subject>
<highschool:subject xmlns:highschool="http://www.abcschool.edu/subjects">
Geometry
</highschool:subject>
<medicalschool:subject xmlns:medicalshool="http://www.rmc.org/subjects">
Cardiology
</medicalschool:subject>
</root>
Example DTD :
<!DOCTYPE note
[
<!ELEMENT note (to,from,heading,body)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
]>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget to complete the work !</body>
< </note>
where root-element is the name of root element and element-declarations is where you
declare the elements.
Example
Following is a simple example of internal DTD:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE address [
<!ELEMENT address (name,company,phone)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT company (#PCDATA)>
<!ELEMENT phone (#PCDATA)>
]>
<address>
<name>Tanmay Patil</name>
<company>TutorialsPoint</company>
<phone>(011) 123-4567</phone>
</address>
Example:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
Example: The following example shows how to use schema:
The basic idea behind XML Schemas is that they describe the legitimate format that an XML
document can take.
The nodes in the node tree have a hierarchical relationship to each other.
The terms parent, child, and sibling are used to describe the relationships. Parent nodes have children.
Children on the same level are called siblings (brothers or sisters).
Following diagram shows how XML parser interacts with XML document:
41. What are the two types of XML parsers? And differentiate them.
Two types of XML Parsers:
1. Non-Validating XML Parsers
2. Validating XML Parsers
1. Discuss in detail about how to create and use variables in PHP with example program.
2. What are the different data types available in PHP? Explain about converting between
different data types with example program.
3. Write a PHP program using arithmetic operator.
4. List and explain any eight built-in functions in PHP.
5. Write a PHP program to do string manipulation. (NOV / DEC 2015)
6. Explain how user-defined functions are created in PHP.
7. Explain how input from an XHTML form is received in a PHP program.
8. How will you connect a PHP program with database? Explain with example application.
9. Explain how cookies are handled in PHP.
10. Explain in detail about using Regular Expressions in PHP.
11. What are different types of DTD? Explain the same with example.
12. Explain the role of XML name spaces with examples. (8) (May / June 2012)
13. What is XML Schema? Explain how to create and use XML Schema document.
(NOV / DEC 2015)
14. Explain how a XML document can be displayed on a browser. (8) (April / May 2011)
15. Explain about DOM. (8) (May / June 2014)
16. Explain Document Tree with an example. (8) (May / June 2011, May / June 2012)
17. Explain in detail about XSL. (8) (Nov / Dec 2013)
18. Give an XSLT document and a source XML document explain the XSLT transformation
process that produces a single result XML document. (16) (Nov / Dec 2012)
19. Explain in detail about XML parsers and validation. (NOV / DEC 2015)
UNIT – V
AJAX: Ajax Client Server Architecture – XML HttpRequest Object – Call Back
Methods; Web Services: Introduction – Java web services basics – Creating, Publishing,
Testing and Describing a web services (WSDL) – Consuming a web service – Database
driven web services from an application – SOAP.
PART – A
1. What is AJAX?
AJAX = Asynchronous JavaScript and XML.
AJAX is a technique for creating fast and dynamic web pages.
AJAX allows web pages to be updated asynchronously by exchanging small amounts of
data with the server behind the scenes. This means that it is possible to update parts of a
web page, without reloading the whole page.
6. Write the syntax to send a request to the server using XMLHttpRequest object.
To send a request to a server, we use the open() and send() methods of the
XMLHttpRequest object:
xmlhttp.open("GET","ajax_info.txt",true);
xmlhttp.send();
Method Description
Specifies the type of request, the URL, and if the request should be
handled asynchronously or not.
open(method,url,async)
method: the type of request: GET or POST
url: the location of the file on the server
async: true (asynchronous) or false (synchronous)
Sends the request off to the server.
send(string)
string: Only used for POST requests
Example
function myFunction()
{
loadXMLDoc("ajax_info.txt",function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
}
});
}
10. List any four merits for usage of AJAX in web service. (NOV / DEC 2015)
1. Reduce the traffic travels between the client and the server.
2. Response time is faster so increases performance and speed.
3. AJAX communicates over HTTP protocol.
4. Asynchronous calls to a web server allows client need not to wait for the arrival of all data
before start rendering.
5. If a section of a page encounters any error, other sections do not get affected and the data
entered by the user is also not lost.
11. What is meant by Web Services? Give any four examples. (NOV / DEC 2015)
A web service is a software component stored on one computer that can be accessed via
method calls by an application ( or other software component) on another computer over a
network. These software components are used by some software applications rather than by end-
users directly.
Example:
Weather forecast system.
Currency converters.
Credit card validation system.
mashups
15. Define WSDL Specification. List out its six major elements .
WSDL is an XML grammar for describing web services. The specification itself is
divided into six major elements:
definitions - The definitions element must be the root element of all WSDL documents.
types -The types element describes all the data types used between the client and server.
message -The message element describes a one-way message, whether it is a single message
request or a single message response.
portType - It defines a web service, the operations that can be performed, and the messages
that are involved.
binding - The binding element describes the concrete specifics of how the service will be
implemented on the wire.
Service - The service element defines the address for invoking the specified service. Most
commonly, this includes a URL for invoking the SOAP service.
16. What is UDDI? (Nov / Dec 2011)
UDDI stands for Universal Description, Discovery and Integration. It is an XML based
specification for registry of web services. It is platform-independent frame work.
PART – B
1. What do you mean by AJAX? Write the advantages of AJAX. (8) (May / June 2014)
2. Explain the AJAX client-server architecture with neat diagram. (NOV / DEC 2015)
3. Explain about the object that helps AJAX reload parts of a web page without reloading the
whole page. (8) (Nov / Dec 2011)
4. Explain in detail about the XMLHttpRequest object with example program.
5. Explain the steps for writing a Java Web Service server and a Java Web Service Client with
an example. (16) (May / June 2012, Nov / Dec 2013)
6. Explain in detail about how to consume a web service with example.
7. Develop a Java Web Service that would do arithmetic operations. (8) (May / June 2014)
8. Describe the significance and working of WSDL with an example. (16) (Nov / Dec 2011)
9. Explain how an application can be connected with databases through web services with neat
example.
10. Explain the SOAP elements in detail. (8)(Nov / Dec 2011, 2012, 2013, May / June 2014)
11. Write short notes on: (i) SOAP (ii) WSDL. (NOV / DEC 2015)