Advanced Java Programming (3160707) MCQs

MCQs of Java Server Pages

Showing 21 to 20 out of 30 Questions
21.
Which option is true about session scope?
(a) Objects are accessible only from the page in which they are created
(b) Objects are accessible only from the pages which are processing the same request
(c) Objects are accessible only from the pages which are in same session
(d) Objects are accessible only from the pages which reside in same application
Answer:

Option (c)

22.
After the translation time,_____ is not part of _jspService().
(a) Declarations
(b) scriptlet
(c) Expression
(d) EL script
Answer:

Option (a)

23.
_jspService()of HttpJspPage class should not be overridden.
(a) True
(b) False
Answer:

Option (a)

24.
In JSP Action tags, which tags are used for bean development?
(a) <jsp:useBean>
(b) <jsp:setPoperty>
(c) <jsp:getProperty>
(d) All mentioned above
Answer:

Option (d)

25.
Which two interfaces does the javax.servlet.jsp package have?
(a) JspPage,HttpJspPage
(b) JspWriter,PageContext
(c) JspPage, JspWriter
(d) none of above.
Answer:

Option (a)

26.
How many jsp implicit objects are there and these objects are created by the web container that are available to all the jsp pages?
(a) 7
(b) 8
(c) 9
(d) 10
Answer:

Option (c)

27.
_____ includes the file at translation whereas the ______ includes the file at runtime.
(a) Page directive, Page action
(b) Include action, Include directive
(c) Include directive, Include directive
(d) Include directive, Page action
Answer:

Option (c)

28.
Identify the correct code.
(a)
Cookie c=new Cookie("c1","abc");
   response.addCookie(c);
(b)
Cookie c=new Cookie("c1","abc");
   request.addCookie(c);
(c)
Cookie c=new Cookie(c1);
   response.addCookie(c);
(d)
Cookie c=new Cookie(c1);
     Request.addCookie(“c1”,”abc”);
Answer:

Option (a)

29.
Which tag is used to set value of javaBean?
(a) <c:choose>
(b) <c:set>
(c) <c:forward>
(d) <c:param>
Answer:

Option (b)

30.
Which of the following is true about Cleanup phase in JSP life cycle?
(a) The destruction phase of the JSP life cycle represents when a JSP is being removed from use by a container.
(b) The jspDestroy() method is the JSP equivalent of the destroy method for servlets.
(c) Both of the above.
(d) None of the above.
Answer:

Option (c)

Showing 21 to 20 out of 30 Questions