Web Technology · Software Engineering and Web Technology
15 questions · asked in 7 of 27 years (2000–2026)
MCQ 151-mark 15
2000Questions per year2026
Questions 11–15 of 15
A HTML form is to be designed to enable purchase of office stationery. Required items are to be selected (checked). Credit card details are to be entered and then the submit button is to be pressed. Which one of the following options would be appropriate for sending the data to the server. Assume that security is handled in a way that is transparent to the form design.
Answer: (B)
A purchase form changes something on the server (it places an order), and it carries private data (card details).
GET puts the form data in the URL. That is meant for fetching data without side effects. URLs have a length limit, and they are stored in browser history, bookmarks, caches and server logs, so card details would be exposed there. Re-sending a GET (refresh, back button) is also treated as harmless, which is wrong for an order.
POST sends the data in the body of the request. It has no practical size limit, it is not cached or bookmarked, and the browser warns before re-submitting it, so it suits an action that creates an order.
Transparent security (such as HTTPS) protects the data on the wire, but it does not change these properties of GET, so POST is the proper method.
Answer: (B)
GET puts the form data in the URL. That is meant for fetching data without side effects. URLs have a length limit, and they are stored in browser history, bookmarks, caches and server logs, so card details would be exposed there. Re-sending a GET (refresh, back button) is also treated as harmless, which is wrong for an order.
POST sends the data in the body of the request. It has no practical size limit, it is not cached or bookmarked, and the browser warns before re-submitting it, so it suits an action that creates an order.
Transparent security (such as HTTPS) protects the data on the wire, but it does not change these properties of GET, so POST is the proper method.
Answer: (B)
Given below are several usages of the anchor tag in HTML.
Which of the above are valid?
I. <A HREF = "http://www.gate.ac.in/HTML/BASIC/testpage.html">Test Me</A>
II. <A HREF = "/BASIC/testpage.html">Test Me</A>
III. <A HREF = "testpage.html">Test Me</A>
IV. <A HREF = "testpage.html#test">Test Me</A>Which of the above are valid?
Answer: (D)
All four are valid hyperlink references (as per RFC 3986):
- I. An absolute URL: it gives the scheme, host and full path.
- II. A relative URL starting with "/": the path is taken from the root of the website.
- III. A relative URL: the path is taken from the location of the current page.
- IV. Same as III, with the fragment
Answer: (D)
- I. An absolute URL: it gives the scheme, host and full path.
- II. A relative URL starting with "/": the path is taken from the root of the website.
- III. A relative URL: the path is taken from the location of the current page.
- IV. Same as III, with the fragment
#test added. The fragment names an anchor in that page, and the browser jumps to it.Answer: (D)
Consider an XML file called intro.xml and a document type definition (DTD) file intro.dtd as follows:
A validating parser will classify intro.xml as
<?xml version = "1.0"?>
<!DOCTYPE myMessage SYSTEM "intro.dtd">
<myMessage>
<message>Welcome to XML</message>
</myMessage>
intro.dtd
<! ELEMENT myMessage (message)>
<! ELEMENT message (#PCDATA)>A validating parser will classify intro.xml as
Answer: (A)
Well-formed means the XML follows the syntax rules. intro.xml has the XML declaration first and a single root element . Inside it, is opened and closed properly and nested correctly. So it is well-formed.
Valid means the document also follows its DTD. The DOCTYPE names the root as myMessage, and the DTD says myMessage contains exactly one element, and message holds only text (#PCDATA). The file has exactly one message element containing the text "Welcome to XML". So a validating parser accepts it as valid.
It is both well-formed and valid, so (B), (C) and (D) are wrong.
Answer: (A)
Valid means the document also follows its DTD. The DOCTYPE names the root as myMessage, and the DTD says myMessage contains exactly one element, and message holds only text (#PCDATA). The file has exactly one message element containing the text "Welcome to XML". So a validating parser accepts it as valid.
It is both well-formed and valid, so (B), (C) and (D) are wrong.
Answer: (A)
Which of the following objects can be used in expressions and scriplets in JSP (Java Server Pages) without explicitly declaring them?
Answer: (D)
JSP provides nine implicit objects that can be used in expressions and scriptlets without declaring them:
Answer: (D)
request, response, out, session, application, config, pageContext, page and exception (the last only in error pages).request is the HTTP request, response is the HTTP response and session is the user's session. All three are in the list, so none of them has to be declared.Answer: (D)
Which one of the following statements is FALSE?
Answer: (B)
Statement B is false. HTTP is only a protocol, and it has nothing to do with how a web page is built. HTML is what gives a web page its structure.
Keep practising
Topics in Software Engineering and Web Technology
Software Engineering
Web TechnologyYou are here