Examines initialization parameter retrieval via getInitParameter(), sharing application-wide data across multiple servlets, and ServletContextListener hooks.
44 Questions44 MCQs0 Short Questions0 Long Questions
π― Exam Practice Papers
SEMESTER PASS
CS311 - Introduction to Web Services Development Examination Practice
Timed practice exam simulation for CS311 - Introduction to Web Services Development.
π VU MID TERM EXAMLectures 1 to 22
β±οΈ 60 Mins
Mid Term Examination
Covers syllabus of Lectures 1 to 22 with 30 high-yield MCQs in a timed exam environment.
β MCQπ CS311π Lec 13π·οΈ 13.6. The XMLHttpRequest Object (Methods and Properties)Easyπβπ‘ππVUποΈVU
Which programmatic object, built into all modern web browsers, allows JavaScript to request and retrieve XML or text data dynamically from a server in the background without reloading the page?
π» javascript Snippet
var xhttp = new XMLHttpRequest();
xhttp.open("GET", "books.xml", true);
xhttp.send();
A.XMLParser Object
B.DOMParser Object
C.XMLHttpRequest Object
D.RequestDispatcher Object
Q12
β MCQπ CS311π Lec 13π·οΈ 13.18. Creating New Elements, Attributes, and Text NodesMediumβπ‘πππVUποΈVU
True or False: In the W3C XML Document Object Model (DOM) specification, the `Document` interface is the unique interface that provides factory methods to create other DOM document components.
π» java Snippet
Element newElement = xmlDoc.createElement("edition");
Attr newAtt = xmlDoc.createAttribute("edition");
In the XML DOM API, which numeric value represents an Element node when evaluating the `nodeType` property of a node?
π» javascript Snippet
if (xmlNode.nodeType == 1) {
// This is an Element node
}
A.1
B.2
C.3
D.9
Q14
β MCQπ CS311π Lec 13π·οΈ 13.2. XML DOM Node Objects and Programming InterfacesEasyπβππVUποΈVU
In the XML Document Object Model (DOM), which programmatic interface or object directly represents an individual node within the hierarchical tree structure?
A.The nodeList object
B.The node object
C.The document object
D.The element object
Q15
β MCQπ CS311π Lec 13π·οΈ 13.18. Creating New Elements, Attributes, and Text NodesEasyβππVUποΈVU
Which of the following node objects can be programmatically instantiated and added to an element by invoking the `createCDATASection()` method of the XML DOM Document interface?
π» javascript Snippet
var newCDATA = xmlDoc.createCDATASection("Special Offer & Book Sale");
A.CDATA section node
B.Element node
C.Text node
D.Comment node
Q16
β MCQπ CS311π Lec 13π·οΈ 13.17. Modifying XML DOM (Append, Replace, and Remove Nodes)Mediumπβπ‘πππVUποΈVU
In the XML DOM programming interface, what happens to the nested child nodes when a parent node is programmatically removed using the `removeChild()` method?
π» javascript Snippet
y = xmlDoc.getElementsByTagName("book");
xmlDoc.documentElement.removeChild(y);
A.The child nodes are preserved and automatically appended to the parent's parent node.
B.All associated child nodes of the removed parent node are also automatically removed.
C.The child nodes become detached but remain accessible as top-level document elements.
D.The browser throws a DOMException indicating that children must be deleted first.
Q17
β MCQπ CS311π Lec 13π·οΈ 13.1. Introduction to XML DOM (Document Object Model)Hardπβπ‘πππVUποΈVU
When you construct an XML document tree using a W3C DOM-enabled parser, is it strictly necessary to use the exact same parser vendor's implementation to process it back?
A.Yes, because DOM classes are strictly proprietary to individual vendor implementations.
B.Yes, but only when the XML document exchange involves legacy enterprise applications.
C.No, this statement is incorrect because the W3C DOM is defined using IDL (Interface Definition Language) to ensure platform and language neutrality.
D.No, but you must use a SAX-enabled parser to bridge the structural gaps between different DOM vendors.
Q18
β MCQπ CS311π Lec 13π·οΈ 13.17. Modifying XML DOM (Append, Replace, and Remove Nodes)Easyπβπ‘ππVUποΈVU
In the XML Document Object Model (DOM), which method is used to create a copy of a specified node?
π» javascript Snippet
var oldNode = xmlDoc.getElementsByTagName('book');
var newNode = oldNode.cloneNode(true);
When parsing an XML document using standard W3C DOM specifications in modern web browsers, how are carriage returns, newlines, and indentation spaces (whitespaces) between elements processed, and what issue does this raise for developers?
π» javascript Snippet
// Compliant browser counts child nodes including whitespace text nodes:
var total = xmlDoc.documentElement.childNodes.length; // May return 9 instead of 4 [3]
A.They are completely ignored by the parser, posing no impact on the resulting node list child count.
B.They are treated as empty Element nodes (nodeType 1), causing structural duplication during navigation.
C.They are parsed as active Text nodes (nodeType 3), which alters the expected count of children in a node list.
D.They cause immediate validation failures and throw a ParserConfigurationException.
Q20
β MCQπ CS311π Lec 13π·οΈ 13.2. XML DOM Node Objects and Programming InterfacesEasyπβππVUποΈVU
Which programmatic object in the W3C XML Document Object Model (DOM) specification directly represents an individual node in the hierarchical tree structure?
A.The nodeList object
B.The node object
C.The document object
D.The attributes object
π Related CS311 - Introduction to Web Services Development Curriculum Units
Continue practicing topic-wise multiple choice questions from adjacent examination units.