When the Tomcat web server installed as part of JWSDP 1.3 returns a…
Question Answered step-by-step When the Tomcat web server installed as part of JWSDP 1.3 returns a… When the Tomcat web server installed as part of JWSDP 1.3 returns a file toa client browser, Tomcat decides what MIME type to provide in the HTTP response, based on the extension of the file’s name. For example, by default a filename ending in .html is given a MIME type of text/html. The default mappingsused by Tomcat are contained in the file conf/web.xml within the JWSDP installation directory. Using the mapping from html to text/html as an example, add a default mapping from the extension xhtml to the MIME type application/xhtml+xml.Copy the files of Figure 5.6 and Figure 5.7 to the webapps/ROOT directory of yourJWSDP installation, and copy TreeOutline.html to the file TreeOutline.xhtml. Finally, restart your Tomcat server, and browse Mozilla 1.4 to http://localhost:8080/TreeOutline.xhtml (assuming that you are running a default Tomcat installation on thesame machine as your browser). How does the alert box displayed when you click the button differ from that of Figure 5.8? Experiment with displaying both TreeOutline.htmland TreeOutline.xhtml in several different browsers as assigned by your instructor, andreport the results.5.13. The function makeCollapsible() in Figure 5.15 inserts nodes into the document treewith calls to insertBefore() or appendChild() immediately after creating them withcalls to createElement() or createText(). In the browser(s) assigned by your instructor, experiment with variations of this code in which you set attribute values onnewly created nodes before adding them to the document tree. Report on the behavior of the browser, noting not only what the browser displays but also any exceptionsthrown.5.14. I mention at the end of Section 5.5.6 that an Element node may have several childrenthat are sibling Text nodes. For one or more browsers assigned by your instructor, writeJavaScript code that outputs (in an alert box) the nodeType of the child nodes of the pElement and the content of any of its Text children after the browser reads the followingmarkup:Refer to the DOM2 Core recommendation [W3C-DOM-2-CORE] to learn about thenormalize() method of Node instances. Apply this method to the p Element corresponding to the markup given, and describe the effect on the collection of child nodes in eachof the assigned browsers.5.15. Write code to perform experiments in the browser(s) assigned by your instructor withthe methods listed in Table 5.9 to answer the following questions: If your code causesa blur event on an element, does another element automatically gain focus? Does a callto click() on an element also give the element focus? What about a call to select()?If your code gives the focus to a text field, where is the cursor located within the field?Does this vary depending on the location of the cursor when the text field last had thefocus?5.16. Many browsers, including Mozilla 1.4 and some versions of IE6, include tools for blocking pop-up windows. Experiment with the pop-up-blocking browser(s) assigned by yourinstructor, and attempt to develop a JavaScript function popupOK() that will reliably detect whether or not the browser allows pop-ups. Demonstrate your function by writing anHTML document that when loaded calls JavaScript code that in turn calls your function,navigating the browser to the URL of an HTML document containing an error messageif the browser does not allow pop-ups. (Note: Even with pop-up blocking enabled, a webbrowser by default may not block documents served from your machine or even othermachines within your Internet domain. See your browser documentation for details andinformation on possibly overriding such settings.) Image transcription textSuppose that there is a polynomial timealgorithm to decide “Is there is apath P that visits each ver… Show more… Show more Image transcription text3. (45 points) For each of the following,indicate whether the claim is TRUE,FALSE, or UNKNOWN, an… Show more… Show more Computer Science Engineering & Technology Networking COM MISC Share QuestionEmailCopy link Comments (0)


