You are on page 1of 7

APPROVED__________________________________________________________

EXAMINATION PAPER:

ACADEMIC SESSION 2007/2008

Campus School Department Level

Maritime Greenwich Computing and Mathematical Sciences Computer Science 3

TITLE OF PAPER COURSE CODE Date and Time

Web Engineering COMP1309 11th December 2007 3 Hours

Answer any FOUR of the following SIX questions. Each question is worth 25 marks. If you answer more than four questions, marks will ONLY be awarded for your FOUR best answers. DICTIONARIES AND ELECTRONIC TRANSLATING DEVICES ARE PERMITTED

View Web Engineering Exam Questions and Answers Guide

COMP1309 Web Engineering

APPROVED__________________________________________________________ 1. (a) It is common practice to validate HTML form data at both the client and the server. (i) (ii) Why is it important to validate data input from HTML forms? Why is it important to validate at both the client and the server?

(iii) What is the primary motivation for client side validation? (iv) What is the primary motivation for server side validation? [13 marks]

(b)

The GET and POST methods of HTTP are both used to send data from HTML forms to server-side applications. Compare and contrast the GET and POST methods. [12 marks]

2.

An article published in March 2006 describes how The government plans to issue new, less technical guidelines on how to make public-sector websites accessible to disabled people. The article continues to report that A study of websites run by the 25 member states of the European Union (EU) found that 97% failed to pass the most basic, internationally agreed standard of website accessibility. In your role as project leader in a web development agency you have been approached by a local authority to develop e-government applications. Discuss the factors and issues involved in the development of a public service website. [25 marks]

COMP1309 Web Engineering Page 2 of 7

APPROVED__________________________________________________________ 3. Study the code of the DHTML web page mySite.html given below. Line numbers have been added that you may refer to in your answer.

(a)

A web page contains an anchor tag with the following markup;


<a href="http://www.bzort.net/mySite.html">mySite</a>

Assuming that the web user agent is compatible with JavaScript 1.5 and CSS level 2 and the URL successfully loads, describe in detail the sequence of actions in the browser following a user click event on this anchor. The code for dhtml.html is given on the following page. You should include in your answer all interactions between the web client and the web server. Your answer should not include any further user interactions. [8 marks]

(b)

Describe in detail using a clearly labelled figure, what you expect to see in the browser when the page has loaded. [8 marks]

(c)

This page demonstrates several interesting behaviours. Describe these behaviours and how they are implemented. [9 marks]

Question 3 continued on next page

COMP1309 Web Engineering Page 3 of 7

APPROVED__________________________________________________________ Question 3 continued mySite.html


01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 <html> <head> <title>Enter mySite</title> <link href="mySite.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="mySite.js"></script> </head> <body onload="initForm()"> <h1 class="centre">Enter mySite</h1> <form method="post" action="foo.php"> <p class="centre"> <input type="text" name="uName"/> <span id="uNameErr">Invalid user name</span> <input type="password" name="uPwd"/> <span id="uPwdErr">Invalid password</span> <br /><br /> <input type="button" value="Sign in" id="doit" onclick="check(this.form)"/> <br />Remember me <input type="checkbox" name="rememberMe"/> </p> </form> </body> </html>

mySite.css
body { font-family:monospace; padding:15px; } h1 { background:#6688AA; margin:0px; padding:1em } .centre { text-align:center; } #uNameErr { color:white; } #uPwdErr { color:white; } #doit:hover { background:#6688AA; color:#FFFF00 }

Question 3 continues on the next page

COMP1309 Web Engineering Page 4 of 7

APPROVED__________________________________________________________ Question 3 continued

mySite.js
function initForm() { var theForm = document.forms[0]; var allCookies = document.cookie; var start = allCookies.indexOf("mySite="); if (start != -1) { start += 7; var end = allCookies.indexOf(";", start); if (end == -1) end = allCookies.length; var mySiteCookie = allCookies.substring(start, end); end = mySiteCookie.indexOf("#"); var s = mySiteCookie.substring(0, end); theForm.uName.value = s; start = end + 1; end = mySiteCookie.length; s = mySiteCookie.substring(start, end); theForm.uPwd.value = s; } else { theForm.uName.value = "username"; theForm.uPwd.value = "password"; } } function check(theForm) { var valid = true; var rex = new RegExp("[; ,#]", ""); if ( rex.test(theForm.uName.value) ) { document.getElementById("uNameErr").style.color = "#FF0000" valid = false; } else { document.getElementById("uNameErr").style.color = "#FFFFFF" } if ( rex.test(theForm.uPwd.value) ) { document.getElementById("uPwdErr").style.color = "#FF0000" valid = false; } else { document.getElementById("uPwdErr").style.color = "#FFFFFF" } if ( valid ) { if ( theForm.rememberMe.checked == true ) { var authDetails = theForm.uName.value + "#" + theForm.uPwd.value; var expire = new Date(); expire.setMonth(expire.getMonth() + 12) var expireGMT = expire.toGMTString(); document.cookie = "mySite=" + authDetails + "; expires=" + expireGMT; } theForm.submit(); } }

COMP1309 Web Engineering Page 5 of 7

APPROVED__________________________________________________________ 4. (a) In the context of the World Wide Web, describe the following using clearly labelled sketches: (i) (ii) A 3-tier system An n-tier system

(iii) An example of a heterogeneous web application that consumes at least two web services. [13 marks]

(b)

Explain the roles played by SOAP, WSDL and UDDI in web service based architectures. [12 marks]

5.

(a)

In February 2007 a UK newspaper reported that Copyright owners are cracking down on the unlicensed use of images. The article includes several cases including a Scottish small business having just been asked for nearly 2,400 for the unauthorised image of a shopping cart. Discuss the intellectual property rights associated with web development. [12 marks]

(b)

In the mid 1980s Richard Stallman introduced the concept of copyleft to protect the freedom to copy use and distribute intellectual property manifest in open source software. Discuss the effect that copyleft and freedom has had on the development of web technologies, the Internet and the World Wide Web. [13 marks]

6.

While it is not specifically stated in the W3C design goals for XML it is often said that, one of the main goals of XML is the separation of content from presentation. (a) What are the design goals of XML as stated by the W3C? [8 marks]

Question 6 continued on next page

COMP1309 Web Engineering Page 6 of 7

APPROVED__________________________________________________________ Question 6 continued (b) What are the advantages of separating of content from presentation? [9 marks]

(d)

Sketch the DOM tree for the following XML: [8 marks]

<?xml version="1.0" ?> <Menu meal="lunch"> <Starter> <Dish>Onion Soup</Dish> <Dish diet="vegan">Salad</Dish> </Starter> <Main> <Dish diet="vegan">Nut Roast</Dish> <Dish>Chicken Vindaloo</Dish> </Main> <Dessert> <Dish diet="vegan">Apple Pie</Dish> <Dish>Ice Cream</Dish> </Dessert> </Menu>

View Web Engineering Exam Questions and Answers Guide

COMP1309 Web Engineering Page 7 of 7

You might also like