1.How constructor can be used for a servlet?
A . Initialization
B . Contructor function
C . Initialization and Contructor function
D . Setup() method
2.Can servlet class declare constructor with ServletConfig object as a argument?
A . True
B . False
C . True and False
D . None of the above
3.What is the difference between servlets and applets?i.Servlets execute on Server; Applets execute on browser ii.Servlets have no GUI; Applet has GUI iii.Servlets creates static web pages; Applets creates dynamic web pages iv.Servlets can handle only a single request; Applet can handle multiple requests
A . i,ii,iii are correct
B . i,ii are correct
C . i,iii are correct
D . i,ii,iii,iv are correct
4.Which of the following code is used to get an attribute in a HTTP Session object in servlets?
A . session.getAttribute(String name)
B . session.alterAttribute(String name)
C . session.updateAttribute(String name)
D . session.setAttribute(String name)
5.Which method is used to get three-letter abbreviation for locale’s country in servlets?
A . Request.getISO3Country()
B . Locale.getISO3Country()
C . Response.getISO3Country()
D . Local.retrieveISO3Country()
6.Which of the following code retrieves the body of the request as binary data?
A . DataInputStream data = new InputStream()
B . DataInputStream data = response.getInputStream()
C . DataInputStream data = request.getInputStream()
D . DataInputStream data = request.fetchInputStream()
7.When destroy() method of filter is called?
A . The destroy() method is called only once at the end of the life cycle of a filter
B . The destroy() method is called after the filter has executed doFilter method
C . Both of the mentioned
D . The destroyer() method is called after the filter has executed
8.Which of the following is true about servlets?
A . Servlets execute within the address space of web server
B . Servlets are platform-independent because they are written in java
C . Servlets can use the full functionality of the Java class libraries
D . Servlets execute within the address space of web server, platform independent and uses the functionality of java class libraries
9.How is dynamic interception of requests and responses to transform the information done?
A . servlet container
B . servlet config
C . servlet context
D . servlet filter
10.Which are the session tracking techniques? i. URL rewriting ii. Using session object iii.Using response object iv. Using hidden fields v. Using cookies vi. Using servlet object
A . i, ii, iii, vi
B . i, ii, iv, v
C . i, vi, iii, v
D . i, ii, iii, v
11.Which of the following is the correct order of servlet life cycle phase methods?
A . init(), service(), destroy()
B . initialize(), service(), destroy()
C . init(), execute(), destroy()
D . init(), service(), delete()
12.Which of the following is true about HTTP Get method?
A . The GET method sends the encoded user information appended to the page request.
B . The GET method is the defualt method to pass information from browser to web server.
C . Both of the above.
D . None of the above.
13.Which of the following code is used to get names of the attributes in servlet?
A . response.getAttributeNames()
B . request.getAttributeNames()
C . Header.getAttributeNames()
D . None of the above.
14.Which of the following code retrieves the request header?
A . Header.getHeaderName(headerName)
B . response.getHeader(headerName)()
C . request.getHeader(headerName)
D . None of the above.
15.Which of the following code encodes the specified URL for use in the sendRedirect method?
A . response.encodeRedirectURL(url)
B . request.encodeRedirectURL(url)
C . Header.encodeRedirectURL(url)
D . None of the above.
16.Which of the following code can be used to add a header?
A . request.addHeader(name,value)
B . response.addDateHeader(name,value)
C . Header.addDateHeader(name,value)
D . None of the above.
17.When init() method of filter gets called?
A . The init() method is called by the web container to indicate to a filter that it is being placed into service.
B . The init() method is called whenever the servlet being filtered is invoked.
C . Both of the above.
D . None of the above.
18.Which of the following is true about javax.servlet.error.status_code?
A . This attribute gives exact error message which can be stored and analysed after storing in a java.lang.String data type.
B . This attribute gives information about exception type which can be stored and analysed after storing in a java.lang.Class data type.
C . This attribute gives status code which can be stored and analysed after storing in a java.lang.Integer data type.
D . This attribute gives information about URL calling the servlet and it can be stored and analysed after storing in a java.lang.String data type.
19.Which of the following code is used to update an attribute in a HTTP Session object in servlets?
A . session.setAttribute(name,value)
B . session.alterAttribute(name,value)
C . session.updateAttribute(name,value)
D . None of the above.
20.Which of the following code is used to delete an attribute from a HTTP
A . Session object in servlets?
B . session.removeAttribute(name)
C . session.alterAttribute(name)
D . session.updateAttribute(name)
21.
A .
B .
C .
D .
☞ Web Technologies -Unit-1 (PHP) Objective Type Questions - [ Web Technologies ]
☞ Web Technologies -Unit-2 (XML) Objective Type Questions - [ Web Technologies ]
☞ Web Technologies -Unit-3 (Servlets) Objective Type Questions - [ Web Technologies ]
☞ Web Technologies -Unit-4 (JSP) Objective Type Questions - [ Web Technologies ]
☞ Web Technologies -Unit-5 (JavaScript) Objective Type Questions - [ Web Technologies ]
☞ PPS MCQs - Unit-1 - [ PPS ]
☞ PPS MCQs - Unit-2 - [ PPS ]
☞ PPS MCQs - Unit-3 - [ PPS ]
☞ Machine Learning MCQs - Unit-1 - [ ML ]
☞ Machine Learning MCQs - Unit-2 - [ ML ]
☞ Data Mining MCQs - Unit-1 - [ DM ]
☞ Data Mining MCQs - Unit-2 - [ DM ]
☞ Data Mining MCQs - Unit-3 - [ DM ]
☞ Data Mining MCQs - Unit-4 - [ DM ]
☞ Data Mining MCQs - Unit-5 - [ DM ]
☞ Object Oriented Programming through Java MCQs - Unit-1 - [ OOP_JAVA ]
☞ Object Oriented Programming through Java MCQs - Unit-2 - [ OOP_JAVA ]
☞ Object Oriented Programming through Java MCQs - Unit-3 - [ OOP_JAVA ]
☞ Object Oriented Programming through Java MCQs - Unit-4 - [ OOP_JAVA ]
☞ Object Oriented Programming through Java MCQs - Unit-5 - [ OOP_JAVA ]
☞ Database Management System Objective Type Question Bank-Unit-1 - [ DBMS ]
☞ Database Management System Objective Type Question Bank-Unit-2 - [ DBMS ]
☞ Database Management System Objective Type Question Bank-Unit-3 - [ DBMS ]
☞ Database Management System Objective Type Question Bank-Unit-4 - [ DBMS ]
☞ Database Management System Objective Type Question Bank-Unit-5 - [ DBMS ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-1 - [ COA ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-2 - [ COA ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-3 - [ COA ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-4 - [ COA ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-5 - [ COA ]
☞ R - Programming MCQs - Unit-1 - [ R-Programming ]
☞ R - Programming MCQs - Unit-2 - [ R-Programming ]
☞ R - Programming MCQs - Unit-3 - [ R-Programming ]
☞ R - Programming MCQs - Unit-4 - [ R-Programming ]
☞ R - Programming MCQs - Unit-5 - [ R-Programming ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-1 - [ FLAT ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-2 - [ FLAT ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-3 - [ FLAT ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-4 - [ FLAT ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-5 - [ FLAT ]
☞ Artificial Intelligence (AI) MCQs - Unit-1 - [ Artificial Intelligence ]
☞ Artificial Intelligence (AI) MCQs - Unit-2 - [ Artificial Intelligence ]
☞ Artificial Intelligence (AI) MCQs - Unit-3 - [ Artificial Intelligence ]
☞ Artificial Intelligence (AI) MCQs - Unit-4 - [ Artificial Intelligence ]
☞ Artificial Intelligence (AI) MCQs - Unit-5 - [ Artificial Intelligence ]
☞ Design and Analysis of Algorithms MCQs - Unit-1 - [ DAA ]
☞ Design and Analysis of Algorithms MCQs - Unit-2 - [ DAA ]
☞ Design and Analysis of Algorithms MCQs - Unit-3 - [ DAA ]
☞ Design and Analysis of Algorithms MCQs - Unit-4 - [ DAA ]
☞ Design and Analysis of Algorithms MCQs - Unit-5 - [ DAA ]
☞ Software Engineering MCQs - Unit-1 - [ SE ]
☞ Software Engineering MCQs - Unit-2 - [ SE ]
☞ Software Engineering MCQs - Unit-3 - [ SE ]
☞ Software Engineering MCQs - Unit-4 - [ SE ]
☞ Software Engineering MCQs - Unit-5 - [ SE ]