Ch 12: Servlet Lifecycle & Request Dispatching

51 Questions51 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 21 โ€“ 30 of 51 Questions
Page 3 of 6
Q21
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 12๐Ÿท๏ธ 12.1. XML Validation (Well-formed vs Valid XML)Medium๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Determine whether the following XML document is well-formed: ```xml Students Teacher ```
๐Ÿ’ป xml Snippet
<!-- Incorrect XML -->
<to age=19>Students</to>
<!-- Correct XML -->
<to age="19">Students</to>
  1. A.Yes, the document is well-formed.
  2. B.No, because the attribute value '19' is not enclosed in quotation marks.
Q22
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 12๐Ÿท๏ธ 12.5. DTD Element Category Declarations (EMPTY, ANY, PCDATA)Medium๐Ÿ”โญ๐Ÿ’ก๐ŸŒŸ๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Which of the following Document Type Definition (DTD) element declarations indicates that the declared element can contain any combination of parsable character data and nested child elements?
๐Ÿ’ป xml Snippet
<!ELEMENT note ANY>
  1. A.``
  2. B.``
  3. C.``
  4. D.``
Q23
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 12๐Ÿท๏ธ 12.4. CDATA vs PCDATA Parsing RulesMedium๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
The term CDATA is used in XML to describe which specific category of data that should not be analyzed or parsed by the XML parser?
๐Ÿ’ป xml Snippet
<script>
<![CDATA[
function matchwo(a,b) {
  if (a < b && a < 0) { return 1; }
  else { return 0; }
}
]]>
</script>
  1. A.Binary audio stream data
  2. B.Plain text character data containing literal markup and reserved symbols
  3. C.Embedded compressed video frames
  4. D.Null object references inside DOM
Q24
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 12๐Ÿท๏ธ 12.5. DTD Element Category Declarations (EMPTY, ANY, PCDATA)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
In a Document Type Definition (DTD), elements that contain only parsed character data are declared using which category specification inside parentheses?
๐Ÿ’ป xml Snippet
<!ELEMENT from (#PCDATA)>
  1. A.`ANY`
  2. B.`#PCDATA`
  3. C.`CDATA`
  4. D.`#DATA`
Q25
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 12๐Ÿท๏ธ 12.9. DTD Attribute Value Types (#REQUIRED, #IMPLIED, #FIXED, Enumerated)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
In a Document Type Definition (DTD) attribute list declaration, which keyword must be used if you do not want to define a default value but still want to force the author to include the attribute on the XML element?
๐Ÿ’ป xml Snippet
<!ATTLIST person number CDATA #REQUIRED>
  1. A.`#IMPLIED`
  2. B.`#IMPLICIT`
  3. C.`#INFERRED`
  4. D.`#REQUIRED`
Q26
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 12๐Ÿท๏ธ 12.5. DTD Element Category Declarations (EMPTY, ANY, PCDATA)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
In a Document Type Definition (DTD), empty elements (such as `
` or ``) must be declared using which category keyword?
๐Ÿ’ป xml Snippet
DTD declaration:
<!ELEMENT br EMPTY>

XML example:
<br />
  1. A.NULL
  2. B.IDLE
  3. C.EMPTY
  4. D.VOID
Q27
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 12๐Ÿท๏ธ 12.1. XML Validation (Well-formed vs Valid XML)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Under standard W3C XML specifications, an XML document is classified as a well-formed document if it meets which of the following rules?
  1. A.It contains at least one root element, but elements can overlap or remain unclosed.
  2. B.It contains exactly one root element, all element tags are correctly nested, and all tags are properly closed.
  3. C.It uses custom tags that match a predefined schema file or external DTD.
  4. D.It is written entirely in lowercase characters with single quotation marks around all attributes.
Q28
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 12๐Ÿท๏ธ 12.1. XML Validation (Well-formed vs Valid XML)Hard๐Ÿ”โญ๐Ÿ’ก๐ŸŒŸ๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
When receiving XML documents from an untrusted external agent, which of the following represents the safest and most robust parsing practice?
  1. A.Use a SAX parser only.
  2. B.Use a DOM parser only.
  3. C.Both SAX and DOM parsers can be used without any additional validation checks.
  4. D.Both parsers can be used, but validity is a critical issue that requires validation against a DTD or XML Schema to verify data integrity.
Q29
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 12๐Ÿท๏ธ 12.1. XML Validation (Well-formed vs Valid XML)Medium๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Determine whether the following XML document is well-formed according to syntax rules: ```xml Tove Jani ```
  1. A.Yes, the document is well-formed.
  2. B.No, because of whitespace and capitalization errors in the XML declaration, and case-sensitivity mismatches between element tags.
Q30
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 12๐Ÿท๏ธ 12.3. DTD Building Blocks (PCDATA, CDATA, Elements, Attributes, Entities)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
In XML Document Type Definitions (DTDs), what does the term PCDATA stand for?
๐Ÿ’ป xml Snippet
<!ELEMENT to (#PCDATA)>
  1. A.Predefined Character Data
  2. B.Parsed Character Data
  3. C.Pure Character Data
  4. D.None of the given options