Deck 2: Servlets and Web Applications
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/25
Play
Full screen (f)
Deck 2: Servlets and Web Applications
1
When might your program wish to run the garbage collecter?
A) Before it enters a compute-intense section of code
B) Before it enters a memory-intense section of code
C) When it knows there will be some idle time
D) All of above
A) Before it enters a compute-intense section of code
B) Before it enters a memory-intense section of code
C) When it knows there will be some idle time
D) All of above
All of above
2
Which method is used to specify before any lines that uses the PrintWriter?
A) setPageType()
B) setContextType()
C) setContentType()
D) setResponseType()
A) setPageType()
B) setContextType()
C) setContentType()
D) setResponseType()
setContentType()
3
Servlet mapping defines
A) an association between a URL pattern and a servlet
B) an association between a URL pattern and a request page
C) an association between a URL pattern and a response page
D) All of the above
A) an association between a URL pattern and a servlet
B) an association between a URL pattern and a request page
C) an association between a URL pattern and a response page
D) All of the above
an association between a URL pattern and a servlet
4
The getSession() method with 'true' as its parameter [ getSession(true)] it will return the appropriate session object when
A) the session is completed
B) the session object is passed to another method
C) the session does not exists
D) the session is existing
A) the session is completed
B) the session object is passed to another method
C) the session does not exists
D) the session is existing
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
5
Dynamic interception of requests and responses to transform the information is done by
A) servlet container
B) servlet config
C) servlet context
D) servlet filter
A) servlet container
B) servlet config
C) servlet context
D) servlet filter
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
6
The method forward (request,response) will
A) return back to the same method from where the forward was invoked
B) not return back to the same method from where the forward was invoked and the web pages navigation continues
C) Both A and B are correct
D) None of the above
A) return back to the same method from where the forward was invoked
B) not return back to the same method from where the forward was invoked and the web pages navigation continues
C) Both A and B are correct
D) None of the above
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
7
What's the difference between servlets and applets?
1) Servlets executes on Servers, where as Applets executes on Browser
2) Servlets have no GUI, where as an Applet has GUI
3) Servlets creates static web pages, where as Applets creates dynamic web pages
4) Servlets can handle only a single request, where as Applet can handle multiple requests
A) 1,2,3 are correct
B) 1,2 are correct
C) 1,3 are correct
D) 1,2,3,4 are correct
1) Servlets executes on Servers, where as Applets executes on Browser
2) Servlets have no GUI, where as an Applet has GUI
3) Servlets creates static web pages, where as Applets creates dynamic web pages
4) Servlets can handle only a single request, where as Applet can handle multiple requests
A) 1,2,3 are correct
B) 1,2 are correct
C) 1,3 are correct
D) 1,2,3,4 are correct
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
8
Which of the following are the session tracking techniques?
A) URL rewriting, using session object, using response object, using hidden fields
B) URL rewriting, using session object, using cookies, using hidden fields
C) URL rewriting, using servlet object, using response object, using cookies
D) URL rewriting, using request object, using response object, using session object
A) URL rewriting, using session object, using response object, using hidden fields
B) URL rewriting, using session object, using cookies, using hidden fields
C) URL rewriting, using servlet object, using response object, using cookies
D) URL rewriting, using request object, using response object, using session object
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
9
The getSession() method with 'true' as its parameter [ getSession(true) ] it will return the appropriate session object when
A) the session is completed
B) the session object is passed to another method
C) the session does not exists
D) the session is existing
A) the session is completed
B) the session object is passed to another method
C) the session does not exists
D) the session is existing
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
10
RequestDispatcher object is used
A) to include other resources
B) to include an image
C) to include xml object
D) to include e-mailing response
A) to include other resources
B) to include an image
C) to include xml object
D) to include e-mailing response
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
11
The include() method of RequestDispatcher
A) sends a request to another resource like servlet, jsp or html
B) includes resource of file like servlet, jsp or html
C) appends the request and response objects to the current servlet
D) None of the above
A) sends a request to another resource like servlet, jsp or html
B) includes resource of file like servlet, jsp or html
C) appends the request and response objects to the current servlet
D) None of the above
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
12
To get the servlet environment information
A) ServletConfig object is used
B) ServletException object is used
C) ServletContext object is used
D) ServletContainer object is used
A) ServletConfig object is used
B) ServletException object is used
C) ServletContext object is used
D) ServletContainer object is used
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
13
The values of <servlet-name> and <servlet-class> in web. xml file
A) must be same
B) must not be same
C) may be same
D) None of the above
A) must be same
B) must not be same
C) may be same
D) None of the above
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
14
What is the limit of data to be passed from HTML when doGet() method is used?
A) 4K
B) 8K
C) 2K
D) 1K
A) 4K
B) 8K
C) 2K
D) 1K
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
15
In which advantage of servlet, Servlets are managed by JVM so no need to worry about memory leak, garbage collection etc. ?
A) Better performance
B) Portability
C) Robust
D) Secure
A) Better performance
B) Portability
C) Robust
D) Secure
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
16
In the following statements identify the disadvantages of CGI?
A) If number of clients increases, it takes more time for sending response
B) For each request, it starts a process and Web server is limited to start processes
C) It uses platform dependent language e. g. C, C++, perl
D) All mentioned above
A) If number of clients increases, it takes more time for sending response
B) For each request, it starts a process and Web server is limited to start processes
C) It uses platform dependent language e. g. C, C++, perl
D) All mentioned above
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
17
Servlet technology is used to create web application?
A) True
B) False
C) all
D) none
A) True
B) False
C) all
D) none
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
18
In HTTP Request Which Asks for the loopback of the request message, for testing or troubleshooting?
A) PUT
B) OPTIONS
C) DELETE
D) TRACE
A) PUT
B) OPTIONS
C) DELETE
D) TRACE
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
19
In HTTP Request method Get request is secured because data is exposed in URL bar?
A) True
B) False
C) all
D) none
A) True
B) False
C) all
D) none
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
20
In the HTTP Request method which is non-idempotent?
A) GET
B) POST
C) BOTH A & B
D) None of the above
A) GET
B) POST
C) BOTH A & B
D) None of the above
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
21
Give the examples of Application Server from the following?
A) Apache
B) JBoss
C) Weblogic
D) Both B & C
A) Apache
B) JBoss
C) Weblogic
D) Both B & C
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
22
Abbreviate the term MIME?
A) Multilevel internet Mail Extension
B) Multipurpose internet Mail Extension
C) Multiuse information Mail Extension
D) None of the above
A) Multilevel internet Mail Extension
B) Multipurpose internet Mail Extension
C) Multiuse information Mail Extension
D) None of the above
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
23
Which packages represent interfaces and classes for servlet API?
A) javax. servlet
B) javax. servlet. http
C) Both A & B
D) None of the above
A) javax. servlet
B) javax. servlet. http
C) Both A & B
D) None of the above
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
24
The web container maintains the life cycle of a servlet instance,give the lifecycle of a servlet?
A) Servlet class is loaded
B) Servlet instance is created
C) init,Service,destroy method is invoked
D) All mentioned above
A) Servlet class is loaded
B) Servlet instance is created
C) init,Service,destroy method is invoked
D) All mentioned above
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
25
What are the contents of web module?
A) JSP files
B) Java classes
C) Gif and Html files and
D) Web component deployment descriptors
A) JSP files
B) Java classes
C) Gif and Html files and
D) Web component deployment descriptors
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck