Font size
WorksheetsXML
Total questions: 82
Worksheet time: 44mins
Which are the main features of XML?
Text data description
Human- and computer-friendly format
Handles data in a tree structure having one-and only one-root element
All mentioned above
Find the correct syntax of the declaration which defines the XML Version?
< ?xml version= "1.0" ? >
< xml version="1.0"/ >
< ?xml version="1.0" / >
None of the above
Which language is case sensitive?
HTML
XML
Both A & B
None of the above
Which are the techniques for defining the structure of a specific type of XML documents?
Schema
DTD
Both A & B
None of the above
Which is not a XML function?
Transport information
Style information
Store information
Structure information
Which Characters are illegal in XML elements?
" < "
"&"
Both A & B
None of the above
Which are the XML Syntax rules?
All XML Elements Must Have a Closing Tag
XML Tags are not Case Sensitive
XML Elements Must be Properly Nested
Both A & C
Well formed XML document means
it contains a root element
it contain an element
it contains one or more elements
must contain one or more elements and root element must contain all other elements
In XML
the internal DTD subset is read before the external DTD
the external DTD subset is read before the internal DTD
there is no external type of DTD
there is no internal type of DTD
Disadvantages of DTD are
(i)DTDs are not extensible
(ii)DTDs are not in to support for namespaces
(iii)there is no provision for inheritance from one DTDs to another
(i) is correct
(i),(ii) are correct
(ii),(iii) are correct
(i),(ii),(iii) are correct
To use the external DTD we have the syntax
<?xml version=”A.0” standalone=”no”?>
<! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>
<?xml version=”A.0” standalone=”yes”?>
<! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>
<?xml version=”A.0” standalone=”no”?>
<! DOCTYPE DOCUMENT “order.dtd”?>
<?xml version=”A.0” standalone=”yes”?>
<! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>
A schema describes
(i) grammer
(ii) vocabulary
(iii) structure
(iv) datatype of XML document
(i) & (ii) are correct
(i),(iii) ,(iv) are correct
(i),(ii),(iv) are correct
(i),(ii),(iii),(iv) are correct
The attribute used to define a new namespace is
A. XMLNS
XmlNameSpace
XMLNS
xmlns
XmlNs
Which of the following is a valid XSLT iteration command
for
for-all
for-each
in-turn
______ tag is an extension to HTML that can enclose any number of JavaScript statements.
<SCRIPT>
<BODY>
<HEAD>
<TITLE>
What is the correct JavaScript syntax to write "Hello World"?
System.out.println("Hello World")
println ("Hello World")
document.write("Hello World")
response.write("Hello World")
What is the correct syntax for referring to an external script called " abc.js"?
<script href=" abc.js">
<script name=" abc.js">
<script src=" abc.js">
None of the above
Which of the following best describes JavaScript?
a low-level programming language.
a scripting language precompiled in the browser.
a compiled scripting language.
an object-oriented scripting language.
JavaScript is interpreted by _________
Client
Server
Object
None of the above
<script type="text/javascript">
x=4+"4";
document.write(x);
</script>
Output------?
44
8
4
Error output
Which page directive should be used in JSP to generate a PDF page?
contentType
generatePdf
typePDF
contentPDF
application is instance of which class?
javax.servlet.Application
javax.servlet.HttpContext
javax.servlet.Context
javax.servlet.ServletContext
“request” is instance of which one of the following classes?
Request
HttpRequest
HttpServletRequest
ServletRequest
Which one of the following is correct for directive in JSP?
<%@directive%>
<%!directive%>
<%directive%>
<%=directive%>
Java code is embedded under which tag in JSP?
Declaration
Scriptlet
Expression
Comment
Which attribute specifies a JSP page that should process any exceptions thrown but not caught in the current page?
The ErrorPage Attribute
The IsErrorPage Attribute
Both A & B
None of the above
Which technology do we mix our business logic with the presentation logic?
Servlet
JSP
Both A & B
None of the above
In JSP page directive which attribute defines the MIME(Multipurpose Internet Mail Extension) type of the HTTP response?
import
contentType
extends
info
In JSP page directive which attribute defines the MIME(Multipurpose Internet Mail Extension) type of the HTTP response?
import
contentType
extends
info
Choose an incorrect statement from the following.
JSP pages are easier to maintain than a servlet.
The Web Container translate a Servlet into JSP page.
JSP is built on Java Technology so it is platform independent.
A JSP page seperates presentation and business logic.
Which syntax is used to comment in JSP?
<!-- Comment -->
<@-- Comment -->
<%-- Comment -->
<&-- Comment -->
Which is an example of the syntax used to import a class to JSP?
<% page import="java.util.List" %>
<%@ page import="java.util.List" @%>
<% import="java.util.List" %>
<%@ page import="java.util.List" %>
Which of the following is syntax of Expression Tag?
<% Expression %>
<%= Expression %>
<& Expression &>
<%! Expression %>
An __________ tag can hold any Java language expression that can be used as an argument to out.println() method.
Expression tag
Declaration Tag/label>
Directive Tag
Scriplet Tag
Never end an expression with semicolon inside Expression Tag?
True
False
Choose the correct syntax of include directive?
<%@ include page="file.jsp" %>
<% include file="file.jsp" %>
<%@ include file="file.jsp" %>
<%! include page="file.jsp" %>
Servlet runs each request in a __________ ?
OS shell
JVM
Separate thread
JRE
GenericServlet class is encapsulated inside __________ package
java.lang
javax.servlet
java.servlet
javax.servlet.http
Which class provide implementation for service() method ?
GenericServlet
HttpServlet
Servlet
none of the above
_________ is responsible for managing execution of servlet
Web Container
Servlet Context
JVM
Server
Which method is called only once in Servlet life cycle ?
service()
initialize()
init()
all of the above
Which of these classes define the getWriter() method that returns an object of type PrintWriter ? Select the one correct answer. ?
HttpServletRequest
HttpServletResponse
ServletConfig
ServletContext
____________ object is available to any servlet or JSPs that are part of the web app and provides communication between servlets and JSPs.
Servlet
ServletConfig
ServletContext
HttpServletContext
If the client has disabled cookie in the browser, which session management mechanism could the web container employ ?
Session Management using Cookies
Session Management using URL rewriting
Either Cookies or URL rewriting
Cookies and URL rewriting must be used together
Which statement about HttpSession is not true?
HttpSession object is used to store entire session with a specific client
Any servlet can have access to HttpSession object through the getSession() method
A session will become invalid as soon as the user close all the browser window
Attribute can be stored, retrieved and removed from HttpSession object
Which statement is true for request.getSession(true) method?
if session already exist, it return the existing session else create a new session
getSession(true) method always returns a new session
getSession(true) method always returns a pre existing session
none
Which method is used access the cookies that are added to response object?
getCookies()
getNewCookies();
cookies();
returnCookies();
Cookies are stored on _______ side.
Client
Server
database
none
Which method is used to delete a session?
invalidateSession()
invalidate()
deleteSession()
delete()
Given request is an HttpServletRequest, which code snippets will creates a session if one doesn't exist?
request.getSession(false);
request.createSession();
request.getNewSession();
request.getSession();
Which method defined in the HttpServletRequest returns the object of RequestDispatcher ?
getRequestDispatcher()
getDispatcher()
getRequest()
requestDispatcher()
Deployment Descriptor(DD) is a _________ .
Servlet used to maintain other servlet.
Text document
XML document that is used by Web Container to run servlets and JSPs.
Library file.
Which implicit object is only available to a JSP page which is designated as error pages?
application
Throwable
runnable
exception
Which implicit object of JSP is equivalent to this variable of Java programming language?
page
pageContext
config
application
Which of the following is syntax of Declaration Tag?
<@ Declaration @>
<% Declaration %>
<& Declaration &>
<%! Declaration %>
A JSP page consists of which tags?
HTML tags
JSP tags
Both A & B
None of the above
How many jsp implicit objects are there and these objects are created by the web container that are available to all the jsp pages?
8
9
10
7
Which of the following are the valid scopes in JSP?
request, page, session, application
request, page, session, global
response, page, session, application
request, page, context, application
“out” is implicit object of which class?
javax.servlet.jsp.PrintWriter
javax.servlet.jsp.SessionWriter
javax.servlet.jsp.SessionPrinter
javax.servlet.jsp.JspWriter
Which of the following action variable is used to include a file in JSP?
jsp:setProperty
jsp:getProperty
jsp:include
jsp:plugin
Which option is true about session scope?
Objects are accessible only from the page in which they are created
Objects are accessible only from the pages which are in same session
Objects are accessible only from the pages which are processing the same request
Objects are accessible only from the pages which reside in same application
Which is not a directive?
include
page
export
useBean
In JSP Action tags which tags are used for bean development?
jsp:useBean
jsp:setPoperty
jsp:getProperty
All mentioned above
Which packages does a JSP API consist of?
javax.servlet.jsp
java.servlet
javax.servlet.jsp.tagext
Both A & C
What is XML ?
Extensible MarkUp Language
Extra Modern Link
Example markup Language
X-Markup Language
Any XML must have
Closing tag
Root element
Nested child
both a and b
Which Statement about xml is true?
Elements may have multiple atrribute with the same name
Quoting attribute is optional.
Elements may nest but not overlap
All of the above.
What is the correct declation syntax for the version of an XML document?
</xml version="1.0"/>
<?xml version="1.0"/?>
<xml version="1.0">
<!xml version="1.0">
____________ is a term used about text data that will be parsed by the XML parser.
CDATA
PCDATA
#DATA
#CDATA
How to describe XML data?
XML uses a DTD to describe the data
XML uses XSL to describe data
XML uses a description node to describe data
Both A and C
Which statement is true?
All XML elements must have a closing tag
All XML elements must be lower case
All XML elements must be lower case
All the statements are true
Which of the following XML documents are well-formed?
<firstElement>some text goes here <secondElement>another text goes here</secondElement> </firstElement>
<firstElement>some text goes here</firstElement> <secondElement> another text goes here</secondElement>
<firstElement>some text goes here <secondElement> another text goes here</firstElement> </secondElement>
</firstElement>some text goes here </secondElement>another text goes here <firstElement>
Which of the following XML fragments are well-formed?
<myElement myAttribute=someValue/>
<myElement myAttribute="someValue"/>
<myElement myAttribute=’someValue’>
<myElement myAttribute="someValue’/>
To use the external DTD we have the syntax
<?xml version=”1.0” standalone=”yes”?> <! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>
<?xml version=”1.0” standalone=”yes”?> <! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>
<?xml version=”1.0” standalone=”no”?> <! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>
How many root elements can we have in XML ?
1
2
3
0
What is XSLT?
Extensible Standard Language Transformation
Extensible Sytlesheet Language Transformation
Extensible Standard List Transformation
Extensible Sytle Language Transformation
How many root elements can we have in XML ?
1
2
3
0
What is XSLT?
Extensible Standard Language Transformation
Extensible Sytlesheet Language Transformation
Extensible Standard List Transformation
Extensible Sytle Language Transformation
How XML describe data
XML uses a description node to describe data
XML uses a DTD to describe the data
XML uses XSL to describe data
which one of the following
is a layer of a computer
program which provides simplified access to data
Business logic layer
Data-access layer
User interface layer
Multi-layer applications
which one is a sequence of characters used to identify or refer to a program or an element, such as a variable or a set of data, within it
Elements
Attributes
Identifiers
Validation
The need of using a DTD in developing XML document is?
Required when validating XML documents.
No longer necessary after the XML editor has been customized.
Used to direct conversation using an XSLT processor.
A good guide to populating templates to be filled in when generating an XML document automatically.
