Aptitude Reasoning English GK Computer Knowledge Programming Skill Banking Software Testing



Question - 1

How do you get the IP address of the client in servlet?

  • get.getRemoteAddr()
  • request.getRemoteAddr()
  • request.getRemoteip()
  • None of the above
Solutions
Question - 2

Which method is used to specify before any lines that uses the PintWriter?

  • setPageType()
  • setContextType()
  • setContentType()
  • setResponseType()
Solutions
Question - 3

What are the functions of Servlet container?

  • Lifecycle management
  • Communication support
  • Multithreading support
  • All the above
Solutions
Question - 4

Which of the following is true about servlets?

  • Servlets execute within the address space of web server
  • Servlets are platform-independent because they are written in java
  • Servlets can use the full functionality of the Java class libraries
  • Servlets execute within the address space of web server, platform independent and uses the functionality of java class libraries
Solutions
Question - 5

What is the full form of JSP?

  • Java servlet program
  • Java server pages
  • Java server pages
  • Java server program
Solutions
Question - 6

Which JDBC driver Type(s) can be used in either applet or servlet code?

  • Both Type 1 and Type 2
  • Both Type 1 and Type 3
  • Both Type 3 and Type 4
  • Type 4 only
Solutions
Question - 7

Which of the following code retrieves the MIME type of the body of the request?

  • new MimeType()
  • request.getContentType()
  • response.getContentType()
  • None of the above
Solutions
Question - 8

Which methods are used to bind the objects on HttpSession instance and get the objects?

  • setAttribute
  • getAttribute
  • Both A & B
  • None of the above
Solutions
Question - 9

Which JDBC driver Type(s) is(are) the JDBC-ODBC bridge?

  • Type 1
  • Type 2
  • Type 3
  • Type 4
Solutions
Question - 10

How many JDBC driver types does Sun define?

  • 1
  • 2
  • 3
  • 4
Solutions
Question - 11

What is javax.servlet.http.HttpServlet

  • interface
  • abstract class
  • concreate class
  • None of the above
Solutions
Question - 12

Which of the following code is used to set the session timeout in servlets?

  • session.setMaxInactiveInterval(interval)
  • response.setMaxInactiveInterval(interval)
  • request.setMaxInactiveInterval(interval)
  • None of the above.
Solutions
Question - 13

Which class provides stream to read binary data such as image etc. from the request object?

  • ServltInputStream
  • ServletOutputStream
  • Both A & B
  • None of the above
Solutions
Question - 14

Which of these ways used to communicate from an applet to servlet?

  • RMI Communication
  • HTTP Communication
  • Socket Communication
  • All mentioned above
Solutions
Question - 15

Which method is used to send the same request and response objects to another servlet in RequestDispacher ?

  • forward()
  • sendRedirect()
  • Both A & B
  • None of the above
Solutions
Question - 16

Which HTTP Request method is non-idempotent?

  • GET
  • POST
  • BOTH A & B
  • None of the above
Solutions
Question - 17

How is the dynamic interception of requests and responses to transform the information done?

  • servlet container
  • servlet config
  • servlet context
  • servlet filter
Solutions
Question - 18

Which of the following code is used to get an attribute in a HTTP Session object in servlets?

  • session.getAttribute(String name)
  • session.alterAttribute(String name)
  • session.updateAttribute(String name)
  • session.setAttribute(String name)
Solutions
Question - 19

Which of the following code encodes the specified URL by including the session ID in it?

  • response.encodeURL(url)
  • request.encodeURL(url)
  • Header.encodeURL(url)
  • None of the above.
Solutions
Question - 20

Which method in session tracking is used in a bit of information that is sent by a web server to a browser and which can later be read back from that browser?

  • HttpSession
  • URL rewriting
  • Cookies
  • Hidden form fields
Solutions
Tags:
60+ Best Servlets Interview Questions, Servlets MCQ questions for placement,Servlets interview questions, Previously asked Servlets Questions, Frequently asked Servlets Questions,Servlets Questions for TCS, Servlets Interview Questions for Freshers, Servlets Interview Questions for Experience, Accenture Servlets Interview Questions, Servlets Objective Questions for Interview


Practice More sets Questions