Vamsi Servlet Question Answer


Hello friends in this post we are going to discuss about Vamsi Servlet MCQ with answers | Vamsi Servlet Multiple choice question | Vamsi Servlet Objective type question with answer | Vamsi Servlet Question answer Wipro TrendNXT Myskillz

If you are looking for more Dumps for MYSKILLZ Visit Here

Out of these 22 quetions 12 are surely coming in servlet Trend Nxt exam . As per my knowledge.These 22 are very imp in that exam.

(1) which is used so that session will never extrude
(Ans) session.setMaxInactiveInterval(-1)

(2) Which JSP implicit object is an instance of the java.lang.Object class
(Ans) Page

(3) difference b/w forward() and sendRedirect() methods
(Ans) The forward() method works at server side.
The sendRedirect() method works at client side.

(4) difference b/w <%@include> and <%jsp:include%>
(Ans) jsp:include Includes a file at requested time
<%@include> Includes a file at tranlated time

(5) which of the following is syntax for printing the value of i
(Ans) <% int i; %>
<% =i%>

(6) servlet error handling syntax
(Ans) javax.servlet.ServletException /ErrorHandler

(7) which header is used in conjuction with 503 error to ask the client to try again after sometime
(Ans) retry-after

(8) What object that provides one point access to page, request, response, session, out, exception, config and application
(Ans) PageContext

(9) what is deployment descriptor
(Ans) web.xml

(10) Which header indicates the URL of the referring Web page
(Ans) Referer

(11)we can override the methods in jsp
(Ans) jspinit(),jspdestroy()


(12)if the parameter appears more than once in jsp ,method to retrive those multiple values
(Ans) getParameterValues()

(13)How to add cookie Username, Joe is
(Ans) response.addCookie(new Cookie(“Username”,”Joe”););

(14).jar files contains all classes located in which folder
(Ans) /WEB-INF/lib

(15)Which method is used to send huge amount of binary data
(Ans) POST

(16)How to import the packages java.sql.,java.util. in JSP
(Ans) <%@ page import=”java.sql.,java.util.” %>

(17)MIME stands for
(Ans) “Multipurpose Internet Mail Extensions”.

(18)Methods in JSP
(Ans) (1) public void jspInit()
(2) public void _jspService(ServletRequest request,ServletResponse)throws ServletException,IOException
(3) public void jspDestroy()

(19)diff between servlet and CGI
(Ans) Servlets are Thread based —server side—platform independent languague as java
and CGI are OS process based —–Client side—platform dependent languague as c,c++

(20)which packages represent interfaces and classes for servlet api.
(Ans) javax.servlet and javax.servlet.http

(21) About Cookie
(Ans) 1)Cookies are maintained at client side
2)public void setMaxAge(int expiry)—– Sets the maximum age of the cookie in seconds.

(22)when the cookies are disabled below are maintain state for session tracking
(Ans) URL rewriting and hidden form field

(23)which method you cannot override in jsp
(Ans) jspservice()


Leave a Reply

Your email address will not be published. Required fields are marked *