Ch 13: Servlet Context & Configuration

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.

πŸ“30 MCQs
⏱️60 Minutes
πŸ“— VU FINAL TERM EXAMLectures 23 to 45
⏱️ 90 Mins

Final Term Examination

Comprehensive semester exam preparation with 45 MCQs covering Lectures 23 to 45 with complete course coverage.

πŸ“45 MCQs
⏱️90 Minutes
Showing 11 – 20 of 44 Questions
Page 2 of 5
Q11
❓ 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();
  1. A.XMLParser Object
  2. B.DOMParser Object
  3. C.XMLHttpRequest Object
  4. 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");
  1. A.True
  2. B.False
Q13
❓ MCQπŸ“˜ CS311πŸ“‘ Lec 13🏷️ 13.13. XML Node Properties (nodeName, nodeValue, nodeType)EasyπŸ”β­πŸ’‘πŸ“„πŸŽ“VUπŸ›οΈVU
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
}
  1. A.1
  2. B.2
  3. C.3
  4. 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?
  1. A.The nodeList object
  2. B.The node object
  3. C.The document object
  4. 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");
  1. A.CDATA section node
  2. B.Element node
  3. C.Text node
  4. 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);
  1. A.The child nodes are preserved and automatically appended to the parent's parent node.
  2. B.All associated child nodes of the removed parent node are also automatically removed.
  3. C.The child nodes become detached but remain accessible as top-level document elements.
  4. 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?
  1. A.Yes, because DOM classes are strictly proprietary to individual vendor implementations.
  2. B.Yes, but only when the XML document exchange involves legacy enterprise applications.
  3. C.No, this statement is incorrect because the W3C DOM is defined using IDL (Interface Definition Language) to ensure platform and language neutrality.
  4. 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);
  1. A.cloneNode()
  2. B.copyNode()
  3. C.importNode()
  4. D.replicateNode()
Q19
❓ MCQπŸ“˜ CS311πŸ“‘ Lec 13🏷️ 13.15. Handling Browser White-space DifferencesMediumπŸ”β­πŸ’‘πŸ“„πŸŽ“VUπŸ›οΈVU
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]
  1. A.They are completely ignored by the parser, posing no impact on the resulting node list child count.
  2. B.They are treated as empty Element nodes (nodeType 1), causing structural duplication during navigation.
  3. C.They are parsed as active Text nodes (nodeType 3), which alters the expected count of children in a node list.
  4. 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?
  1. A.The nodeList object
  2. B.The node object
  3. C.The document object
  4. D.The attributes object