Servlet - TechFAQ360

18 downloads 891 Views 7KB Size Report
SCWCD Mock Questions : Servlet. ************************************************** ******************. Question No :1. URLConnection instance represents a link ...
******************************************************************** www.techfaq360.com SCWCD Mock Questions : Servlet ******************************************************************** Question No :1 URLConnection instance represents a link for accessing or communicating with the resource at the location? (Choose correct one from multiple below) 1. true 2. false 3. can't say 4. none of the above correct is :1 -----------------------------------------------------------------------------Question No :2 When u try to redirect a page after you already have written something in your page, the error encountered is ?Response has already been committed error? or popularly called 402 error.? (Choose correct one from multiple below) 1. true 2. false 3. can't say 4. none of the above correct is :1 -----------------------------------------------------------------------------Question No :3 URL encoding is the method of replacing all the spaces and other extra characters into their corresponding _______ Characters ? (Choose correct one from multiple below) 1. Decimal 2. Hex 3. Octal 4. Binay correct is :2 -----------------------------------------------------------------------------Question No :4 All the ___________ data is kept at the application server ___________ data is kept at the web server ?

(Choose correct one from multiple below)

1. Servlet, HTML 2. HTML, Servlet 3. dynamic, static 4. static, dynamic correct is :3 -----------------------------------------------------------------------------Question No :5 State true or false -- It is possible to call an external application like MSWord by the click on the JSP page or Servlet? (Choose correct one from multiple below) 1. true 2. false 3. can't say 4. none of the above correct is :1 -----------------------------------------------------------------------------Question No :6 What is the possible way of communication between applet and Servlet ? (Choose correct one from multiple below) 1. RMI Communication 2. Socket Communication 3. HTTP Communication (Text-based and object-based) 4. All of the above correct is :4 -----------------------------------------------------------------------------Question No :7 If the session object is invalidated can it be again regained or refreshed? (Choose correct one from multiple below) 1. yes 2. no 3. can't say 4. none of the above correct is :2 -----------------------------------------------------------------------------Question No :8 What is the role played by Servlet in the MVC architecture ? (Choose correct one from multiple below) 1. Model 2. View 3. Controller

4. None of the above correct is :3 -----------------------------------------------------------------------------Question No :9 The listener is notified when the Servlet context (i.e., the Web application) is initialized and destroyed/ (Choose correct one from multiple below) 1. Session Attribute 2. Servlet context attribute 3. Session Listeners 4. Servlet context listeners correct is :4 -----------------------------------------------------------------------------Question No :10 The______________ listener is notified when attributes are added to, removed from, or replaced in the Servlet context? (Choose correct one from multiple below) 1. Session Attribute 2. Servlet context attribute 3. Session Listeners 4. Session context Listeners correct is :2 -----------------------------------------------------------------------------Question No :11 The ________ listeners are notified when session objects are created, invalidated, or timed out. (Choose correct one from multiple below) 1. Servlet context listeners 2. Session Listeners 3. Servlet context attribute 4. Session Attribute correct is :2 -----------------------------------------------------------------------------Question No :12 There is a limit to the max amount of data that can be stored in the session object ? (Choose correct one from multiple below) 1. true 2. false 3. can't say 4. none of the above

correct is :2 -----------------------------------------------------------------------------Question No :13 The maximum length of the session Id(length identifier) is ___________? (Choose correct one from multiple below) 1. 2k 2. 4k 3. 6k 4. 8k correct is :2 -----------------------------------------------------------------------------Question No :14 The browsers are only required to accept________ cookies per site? (Choose correct one from multiple below) 1. 20 2. 16 3. 30 4. 22 correct is :1 -----------------------------------------------------------------------------Question No :15 The ___ indicates that the cookie will expire once the browser is closed? (Choose correct one from multiple below) 1. cookie.setMaxAge(-1) 2. cookie.setMaxAge(0) 3. cookie.setMaxAge(365) 4. cookie.setMaxAge(1) correct is :1 -----------------------------------------------------------------------------Question No :16 The ____ is used to delete a cookie? (Choose correct one from multiple below) 1. cookie.setMaxAge(-1) 2. cookie.setMaxAge(1) 3. cookie.setMaxAge(0) 4. cookie.setMaxAge(-2) correct is :3 -----------------------------------------------------------------------------Question No :17 Which of the option correctly defines the methods in the HttpServelet class ? (Choose correct one from multiple below)

1. protected void doGet (ServletRequest request, HttpServletResponse response) throws ServletException, IOException 2. protected void doPost(ServletRequest request, HttpServletResponse response) throws ServletException, IOException 3. protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 4. none of the above correct is :3 -----------------------------------------------------------------------------Question No :18 If the data being submitted is sensitive, then it's always preferred to use _____________ method ?

(Choose correct one from multiple below) 1. doGet 2. doPost 3. service 4. None of the above correct is :2 -----------------------------------------------------------------------------Question No :19 The mails can be send from the Servlet by the usage of the following ...

(Choose correct one from multiple below) 1. Simple Mail Transfer Protocol (SMTP) implementation in Java. 2. Java Mail API 3. Both a and b 4. Neither a and b correct is :3 -----------------------------------------------------------------------------Question No :20 Which of the following statements is true for reducing the number of writes to the client from the Servlet? (Choose correct one from multiple below) 1. Use StringBuffer instead of String even for concatenating a group of Strings. 2. Avoid writing every small string to client 3. All of the above. 4. None of the above

correct is :2 -----------------------------------------------------------------------------Question No :21 The ________________ is used to call other Servlet or JSP from the current Servlet ?

(Choose correct one from multiple below) 1. ResponseDispatcher 2. RequestDispatcher 3. ServletInvoker 4. None of the above correct is :2 -----------------------------------------------------------------------------Question No :22 Calling of which of the following method causes unpredictable results in the Servlet. ?

(Choose correct one from multiple below) 1. doPost() 2. doGet() 3. System.out.println() 4. System.exit(0); correct is :4 -----------------------------------------------------------------------------Question No :23 Which of the following statement is true about Servlet chaining ? (Choose correct one from multiple below) 1. It is the process of chaining the output of one Servlet to the another 2. Need to do special configuration in the Java Web servers for this process to run. 3. This concept has been removed from the standard application for servlets. 4. None of the above correct is :1 -----------------------------------------------------------------------------Question No :24 An HTTP Servlet handles client requests through its service() method. (Choose correct one from multiple below) 1. True 2. False

3. Can't say 4. None of the above correct is :1 -----------------------------------------------------------------------------Question No :25 The _________interface provides information to servlets regarding the environment in which they are running? (Choose correct one from multiple below) 1. ServletContext 2. Request 3. Session 4. HttpServletRequest correct is :1 -----------------------------------------------------------------------------Question No :26 Which of the following statements is true about the GenericServlet. ?

(Choose correct one from multiple below) 1. The GenericServlet has a service() method that gets called when a client request is made. 2. As of only Http is implemented completely in GenericServlet 3. GenericServlet is for servlets that might not use HTTP, like for instance FTP service. 4. GenericServlet is called by both incoming requests and the HTTP requests are given to the servlet as they are. correct is :3 -----------------------------------------------------------------------------Question No :27 The following is the sequence of the life cycle of the servlets 1. init() 2. destroy() 3. service() (Choose correct one from multiple below) 1. 1,3,2 2. 2,3,1 3. 1,3,2 4. 1,2,3 correct is :1 -----------------------------------------------------------------------------Question No :28 Can the argument constructor be used instead of init () to initialize a Servlet?

(Choose correct one from multiple below) 1. Yes 2. No 3. Can't say 4. none of the above correct is :2 -----------------------------------------------------------------------------Question No :29 Which of the following point is true regarding the general and selling point of Servlet ? (Choose correct one from multiple below) 1. A Servlet can handle multiple requests concurrently, and synchronize requests. 2. Servlet support systems such as online real-time conferencing. 3. Servlet can forward requests to other servers and Servlet. 4. Servlet can be used to balance load among several servers that mirror the same content, and to partition a single logical service over several servers, according to task type or organizational boundaries correct is :1 -----------------------------------------------------------------------------Question No :30 Which packages in the java provide the writing of the Servlet? (Choose correct one from multiple below) 1. java.lang 2. java.io 3. java 4. javax correct is :4 -----------------------------------------------------------------------------Distribution of this pdf is illegal without permission of techfaq360.com

Suggest Documents