Dhanalakshmi College of Engineering Chennai: CSE Cs6501 Internet Programming
Dhanalakshmi College of Engineering Chennai: CSE Cs6501 Internet Programming
CHENNAI
PREPARED BY,
K.REVATHY, AP/CSE
UNIT-I
JAVA PROGRAMMING
6. Define Polymorphism
Polymorphism literally means taking more than one form. Polymorphism is defined as characteristic
of being able to assign a different behaviour or value in a subclass, to something that was declared in a
parent class.
9. List out the motivation needed in generic programming. (N/D- 11) [2 Marks]
The motivation needed in generic programming are :
To motivate generic methods, that contains three overloaded print Array methods
This methods print the string representations of the elements of an integer array, double array and
character array
Choose to use arrays of type Integer, double and character to setup our generic methods
10. What are the uses are of assert keyword? (M/J- 11) (N/D- 11) [2 Marks]
Java assertion feature allows developer to put assert statements in Java source code to help unit testing and
debugging. Assert keyword validates certain expressions. It replaces the if block effectively and throws an
Assertion Error on failure.
12. What is meant by synchronization and why is it important? (N/D -10) [2 Marks]
Synchronization is the capability to control the access of multiple threads to share resources without
synchronization, it is possible for one thread to modify a share, the object while another thread is in the
process of using of updating that object value this often leads to significant errors.
13. How is throw exception created in exception handling? (N/D- 11) [2 Marks]
Throw method is used to throw an exception manually. It has to declare the exceptions thrown in the
method signature and then include a throw statement in the method
throw new ExceptionName (Value);
15. What are the purposes of the finally clause of a trycatchfinally statement?
The finally clause of the try-catch-finally statements is always executed unless the thread of execution
terminates or an exception occurs within the execution of the finally clause.
20. What are the classes of exceptions caught by a catch clause? [2 Marks]
A Throwble class is a super class .It includes all the classes whatever is covered from catch class.
24. What is meant by daemon thread? Which method is used to create the daemon thread? [2 Marks]
A daemon thread is a thread that does not prevent the JVM from exiting when the program finishes
but the thread is still running. An example for a daemon thread is the garbage collection.You can use the
setDaemon() method to change the Thread daemon properties.
UNIT II
TEXT PROPERTIES:
CLIENT-SIDE PROGRAMMING:
Expression statement: that consists entirely of an expression Block statement: that consists of set of
statements enclosed in braces { }
Keyword statement: that begin with keywords such as var, if, for etc
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.
UNIT III
An event listener is a function that takes a single argument that is an instance of Event. A call to the
addEventListener [] method on a node object associates an event listener with a type of event occurring on
that node.
2. What is DOM? [2 marks]
DOM [Document Object Model] is an API that defines how JavaScript programs can access and
manipulate the HTML document currently displayed by a browser. It includes the definition of the
properties of document object, many of which are themselves objects with their own properties.
Every element in a document tree refers to a Node object. Some nodes of the tree are
JavaScript objects corresponding to HTML elements such html or body.
The document object itself is considered to be DOM tree node with node type 9 and symbolic
constant DOCUMENT_NODE and it has its own properties and methods
7. What are the 2 traditional ways of assigning event handlers in DOM [2 marks]
<html>
<body>
<script type="text/javascript">
document.body.bgColor="lavender";
</script>
</body>
</html>
EVENT HANDLING
1. List out some of the HTML intrinsic event attributes. [A/M -11] [2 marks]
onload, onclick, ondblclick, onmousedown, onmouseup, onmousemove, onfocus, onblur,
onkeypress, onkeydown, onselect, onchange, onsubmit, onreset etc.
Bubbling listener is a listener associated with an ancestor of the target node and that was
created with a call to addEventListener[] and had its third argument set to false
e.g.ancestor.addEventListener.
6. List the possible opacity attributes of dynamic positioning. [A/M -08] [2 marks]
HTML: The basic building block.
Document Object Model: The objects that make up the contents of any Web page.
JavaScript: A scripting language that can manipulate the within the document
7. Define Session [2 marks]
Collection of HTTP requests, all associated with a single session ID, is known as a session.
Sessions are maintained by communication between clients and servers.
10. Write the code to return the full URL of a document. [N/D-11] [2 marks]
<html>
<head>
<title>Javascript get url</title>
</head>
<body>
<script>
document.write[document.location.href]
</script>
</body>
</html>
doGet[]
doPost[]
doOptions[]
doPut[]
doTrace[]
doDelete[]
doHead[]
UNIT IV
XML
14. Write the expansion for the following. i] XSL ii] JAXP III] CGI iv] JSP [2 Marks]
1. JAXP Sun Java SPI for XML Processing
2. XSL - Extensible Style Sheet Language
3. CGI Common Gateway Interface
4. JSP Java Server Pages
JSP TECHNOLOGY
1. Give the advantages of using JSP for server side programming. [M/J-12][2 Marks]
The advantages of using JSP for server side programming are
1. JSP are translated and compiled into JAVA servlets but are easier to develop than JAVA servlets.
2. JSP have all advantages of Java i.e write once run anywhere.
3. JSP uses simplified scripting language based syntax for embedding HTML into JSP.
4. JSP containers provide easy way for accessing standard objects and actions.
5. JSP use HTTP as default request /response communication paradigm and thus make JSP ideal as
Web Enabling Technology.
5. MPEG2
exception to this is the import attribute, which can be used repeatedly to import Java packages used
in the JSP.
13. What are the components of Model View Controller Paradigm? [2 Marks]
1. Model: These are software components that represent the persistent data of the
application and server-side processing performed on this data.
2. View: This component generally obtain data from the request and/or model components
and then generate an HTTP response that presents a formatted view of this data.
3. Controller: This component receives all incoming HTTP requests and provides a single
point of entry to the application and does application-wide tasks such as initialization,
logging, and controlling access to the application.
CASE STUDY
1. What is JSTL? [2 Marks]
JavaServer Pages [JSP] technology provides a simplified, fast way to create dynamic web
content. JSP technology enables rapid development of web-based applications that are server- and
platform-independent.
UNIT V
SOAP
WEB SERVICES
8. Define - Web Service [2 marks]
A web service is a server application that uses HTTP to accept and return SOAP documents, where
the content of the documents is specified by a WSDL document that uses embedded XML Schema
markup to define data types.
12. Write the basic rules for service endpoint interface. [2 marks]
i. The interface must extend the java.rmi.Remote interface
ii. Every method in the interface must throw java.rmi.RemoteException
iii. Every method parameter and every return value must conform to certain restrictions on the
allowed data types
iv. The interface must not contain any public static final declarations.
XML SCHEMA
ii. Document
AJAX
Ajax is abbreviated as Asynchronous Javascript and XML. It is new technique used to create better, faster
and more interactive web systems or applications. Ajax uses asynchronous data transfer between the
Browser and the web server.
This technique is used to make internet faster and user friendly. It is not a programming language.
ScriptManager
ScriptManagerProxy
UpdatePanel
UpdateProgress
Timer
33. What is the name of the DLL that contains Ajax control tool kit?
Ajaxcontroltoolkit.dll is the DLL used for Ajax control tool kit and it can be downloaded from the internet.
It can be added in the tool box or copied directly in the bin folder.
Bandwidth utilization It saves memory when the data is fetched from the same page.
More interactive
Speeder retrieval of data
1. AJAX is dependent on Javascript. If there is some Javascript problem with the browser or in the OS,
Ajax will not support
2. Ajax can be problematic in Search engines as it uses Javascript for most of its parts.
3. Source code written in AJAX is easily human readable. There will be some security issues in Ajax.
4. Debugging is difficult