Program Name:
Course Code and Name: (MCAT-401) Advanced Java
Attempt all Questions
Q1. Which of these statements are not true about GenericServlet
A
Options
Generic Servlet is an abstract class
Q2. Which statement is true about HttpServlet ?
A
Options
This is an abstract class
Q3. Which of the following are implicit objects in JSP ?
A
Options
Application, out
Q4. The maximum age of cookie in the JSP can be set by ?
A
Options
cookie.setAgeMax(int seconds)
Q5. Which of the following should not be overriden in JSP ?
A
Options
jspInit
Q6. Which class can handle any type of request so that it is protocol-independent?
A
Options
GenericServlet
Q7. How many ServletContext objects are available for an entire web application ?
A
Options
Only one
Q8. A servlet maintains session in
A
Options
Servlet Container
Q9. The life cycle of a servlet is managed by
A
Options
servlet context
Q10. Which of the following JSP variables are not available within a JSP expression.
A
Options
out
Q11. Which of the following are session tracking techniques ?
A
Options
URL rewriting, using session object, using response object, using hidden fields
Q12. Which of the following is not true about servlets
A
Options
They are instantiated every time a request is made.
Q13. What is the possible way of communication between applet and servlet
A
Options
HTTP Communication(Text-based and object-based)
Q14. If you were to add an instance field in the JSP, which element would you use
A
Options
expression( <%=%>
Q15. Java code is embedded under which tag in JSP?
A
Options
Declaration
Q16. Which one of the following is correct for directive in JSP?
A
Options
<%@directive%>
Q17. Which method shows the client what the server is receiving ?
A
Options
goGet
Q18. Through which you can define servlet context in web.xml
A
Options
config-param
Q19. The < % return; % > simply aborts the processing of JSP?
A
Options
1
Q20. Which of the following can be used to store client side user state information while avoiding any imapct due to the
A
Options
Cookies
Department of Computer App
April Sessional - 2020
MCA
A Generic Servlet has a service() method to handle requests.
HttpServlet extends GenericServlet and adds support for doGet(),do Post()
config, exception
cookie.setAgeMax(float seconds)
jspDestroy
ent?
HttpServlet
ion ?
One each per servlet
B
Servlet context
servlet Container
ession.
session
URL rewriting, using session object, using cookies, using hidden fields
They are a mechanism used by the class loader to download applets
Socket Communication
use
declaration( <%!%>
Scriptlet
B
<%!directive%>
doOption
context-param
B
false
tion while avoiding any imapct due to the users web browser configuration ?
URL rewriting
partment of Computer Application
April Sessional - 2020
MCA
Generic Servlet extends HttpServlet and override doGet() method.
Service method defined here only take http specific request
page, pageContext
cookie.setMaxAge(float seconds)
_jspService
Both A & B
One each per request
C
Servlet reuest heap
the supporting protocol(such as http or https)
request
URL rewriting, using servlet object, using response object, using cookies
They can be used instead of CGI scripts.
RMI Communication
page directive( <%@%>
Expression
C
<%directive%>
doTrace
init-param
C
can't say
Http Sessions
Semester:
Generic Servlet implements Servlet Interface and over-rides life cycle method.
All of these
request, response, session
cookie.setMaxAge(int seconds)
jspService
None of the above
One each per response
D
Servlet response heap
all of the above
httpsession
URL rewriting, using request object, using response object, using session object
They require a web browser that supports JDK 1.1
All of the above
None of the above
Comment
D
<%=directive%>
doPost
All of these
D
None of the above
Hidden tags
IV
Mark:20
Ans
C
Ans
Ans
Ans
Ans
Ans
Ans
A
Ans
Ans
Ans
Ans
Ans
Ans
Ans
Ans
B
Ans
Ans
Ans
Ans
Ans