Select chapter



basics (7.papers)
constructors (1.papers)
packages (1.papers)
inheritance (7.papers)
misc (3.papers)
exceptions (5.papers)
threads (4.papers)
overloading (1.papers)
jsp (3.papers)
servlets (9.papers)
jdbc (2.papers)
util (1.papers)
xml (2.papers)
IO stream (3.papers)
Hide

Sponsored Links


  

java jsp interview questions and answers

Show Answer
Share Facebook gmail Twitter
2
Which of the following is correct JSP syntax to forward to a servlet? 
  1. <jsp:forward page="myservlet">
    
  2. <%@jsp:forward page="myservlet">
    
  3. <jsp:forward url="myservlet">
  4. <jsp:forward servlet="myservlet">
    
Show Answer
Share Facebook gmail Twitter
3
How can you get a request attribute "email" in doStartTag()  method?
  1. pageContext.getAttribute("email");
  2. getJspContext().getAttribute("email")
  3. request.getAttribute("email")
  4. request parameters are not available in doTag() method
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
7
Which of the following best describes the life cycle of a JSP?
  1. For all the request for a JSP page comes in 
    it is translated into a servlet code 
    Servlet code is compiled 
    Servlet is loaded into memory 
    Servlet instance is created 
    
  2. When a request 1st  JSP page comes in 
    it is translated into a servlet code 
    Servlet code is compiled 
    Servlet is loaded into memory 
    Servlet instance is created 
    
  3. When a request 1st  JSP page comes in 
    JSP is compiled 
    JSP is translated into a servlet code 
    Servlet is loaded into memory 
    Servlet instance is created 
    
  4. For all  JSP page comes in 
    JSP is compiled 
    JSP is translated into a servlet code 
    Servlet is loaded into memory 
    Servlet instance is created 
Show Answer
Share Facebook gmail Twitter
8
How can you get a request attribute "email" in doTag() method?
  1. pageContext.getAttribute("email");
  2. getJspContext().getAttribute("email")
  3. request.getAttribute("email")
  4. request parameters are not available in doTag() method
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
11
What is the implicit object that represents ServletContext?
  1. session
  2. application
  3. context
  4. servletContext
Show Answer
Share Facebook gmail Twitter
12
The out implicit object is an instance of a ________object.
  1. JspWriter
  2. PrintWriter
  3. ObjectWriter
  4. ServletWriter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
14
Which of the following is not a JSP life cycle method?
  1. jspInit() 
  2. jspDestroy()
  3. jspService()
  4. _jspService()
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
19
Which of the following is JSP directive?
  1. include
  2. exclude
  3. import
  4. taglibrary
Show Answer
Share Facebook gmail Twitter
20
How you will create error page in jsp?
  1. %@ page isErrorPage="false"%
  2. %@ page isErrorPage="true"%
  3. %@ page ErrorPage="error.jsp"%
  4. <% page ErrorPage="error.jsp"%>
Show Answer
Share Facebook gmail Twitter
Read more papers :