0% found this document useful (0 votes)
143 views

JSP Mock Test IV PDF

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
143 views

JSP Mock Test IV PDF

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

JSP MOCK TEST

http://www.tutorialspoint.com Copyright © tutorialspoint.com

This section presents you various set of Mock Tests related to JSP Framework. You can download
these sample mock tests at your local machine and solve offline at your convenience. Every mock
test is supplied with a mock test key to let you verify the final score and grade yourself.

JSP MOCK TEST IV

Q 1 - 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.

Q 2 - Which of the following is true about <jsp:useBean> action?

A - useBean action first searches for an existing object utilizing the id and scope variables. If an
object is not found, it then tries to create the specified object.

B - useBean is used to load java beans in jsp page.

C - Both of the above.

D - None of the above.

Q 3 - Which of the following is true about <jsp:setProperty> action?

A - The setProperty action sets the properties of a Bean.

B - The Bean must have been previously defined before using setProperty action.

C - Both of the above.

D - None of the above.

Q 4 - Which of the following is true about <jsp:getProperty> action?

A - The getProperty action gets the properties of a bean.


B - The getProperty action converts the property of a bean to a string, and finally inserts it into
the output.

C - Both of the above.

D - None of the above.

Q 5 - Which of the following is true about <jsp:forward> action?

A - The forward action terminates the action of the current page.

B - The forward action forwards the request to another resource such as a static page, another
JSP page, or a Java Servlet.

C - Both of the above.

D - None of the above.

Q 6 - Which of the following is true about response.sendRedirecturl?

A - The sendRedirect sends HTTP temporary redirect response to the browser.

B - Request data gets lost in case of sendRedirect.

C - Both of the above.

D - None of the above.

Q 7 - What JSTL stands for?

A - JavaServer Pages Standard Tag Library

B - JSP Tag Library

C - Java Standard Tag Library

D - None of the above.

Q 8 - What is Internationalization?

A - Internationalization means creating international content on a website.

B - Internationalization means enabling a web site to provide different versions of content


translated into the visitor's language or nationality.

C - Internationalization refers to creating local content on a website.

D - None of the above.

Q 9 - What is Localization?

A - Localization refers to creating local content on a website.

B - Localization refers to adding locale related information to a website.

C - Localization means adding resources to a web site to adapt it to a particular geographical or


cultural region for example Hindi translation to a web site.
D - None of the above

Q 10 - Which of the following is true about locale?

A - This is a particular cultural or geographical region.

B - Locale is usually referred to as a language symbol followed by a country symbol which are
separated by an underscore.

C - Both of the above.

D - None of the above.

Q 11 - What is difference between <%-- comment --%> and <!-- comment -->?

A - <%-- comment --%> is JSP comment. <!-- comment --> is an HTML comment.

B - <%-- comment --%> is ignored by JSP container.

C - <!-- comment --> is ignored by browser.

D - All of the above.

Q 12 - Is JSP technology extensible?

A - true

B - false

Q 13 - Can a JSP page process HTML FORM data?

A - true

B - false

Q 14 - Can you make use of a ServletOutputStream object from within a JSP page?

A - true

B - false

Q 15 - How to pass information from JSP to included JSP?

A - Using <%jsp:param> tag.

B - Using <%jsp:page> tag.

C - Using <%jsp:import> tag.

D - Using <%jsp:useBean> tag.

Q 16 - What is the use of <c:set > tag?

A - It can save values to database.


B - It evaluates an expression and uses the results to set a value of a JavaBean.

C - It can be used to iterate list of elements.

D - None of the above.

Q 17 - What is the use of <c:remove > tag?

A - It removes a item from a list

B - it removes the data row from the database.

C - It removes a variable from either a specified scope or the first scope where the variable is
found

D - None of the above.

Q 18 - What is the use of <c:catch> tag?

A - to catch any Throwable that occurs in its body and optionally exposes it.

B - to catch the runtime error and redirect to error page.

C - Both of the above.

D - None of the above.

Q 19 - What is the use of <c:if> tag?

A - It is used to check if jsp tag library is enabled or not.

B - It evaluates an expression and displays its body content only if the expression evaluates to
true.

C - Both of the above.

D - None of the above.

Q 20 - Which of the following is true about <c:choose> tag?

A - The <c:choose> works like a Java switch statement in that it lets you choose between a
number of alternatives.

B - The <c:choose> tag has <c:when> tags.

C - The <c:choose> tag has <otherwise> as default clause.

D - All of the above.

Q 21 - Which of the following is true about <c:forEach > tag?

A - The <c:forEach > exists as a good alternative to embedding a Java for, while, or do-while loop
via a scriptlet.

B - The <c:forEach > is used to iterate over a list of items in jsp.

C - Both of the above.

D - None of the above.


Q 22 - Which of the following is true about <c:param> tag?

A - The <c:param> tag allows proper URL request parameter to be specified with URL.

B - The <c:param> tag does any necessary URL encoding required

C - Both of the above.

D - None of the above.

Q 23 - Which of the following is true about <c:redirect> tag?

A - The <c:redirect > tag redirects the browser to an alternate URL by providing automatically
URL rewriting.

B - The <c:redirect > tag supports context-relative URLs.

C - The <c:redirect > tag supports <c:param> tag.

D - All of the above.

Q 24 - Which of the following is true about <c:url> tag

A - The <c:url> tag formats a URL into a string and stores it into a variable.

B - The <c:url> tag automatically performs URL rewriting when necessary.

C - Both of the above.

D - None of the above.

Q 25 - What's the difference between JavaBeans and taglib directives?

A - Taglibs are for generating presentation elements while JavaBeans are good for storing
information and state.

B - Custom tags are used to implement actions and JavaBeans are used to present information.

C - Both of the above.

D - None of the above.

ANSWER SHEET

Question Number Answer Key

1 C

2 C

3 C

4 C

5 C

6 C
7 A

8 B

9 C

10 C

11 D

12 A

13 A

14 B

15 A

16 B

17 C

18 A

19 B

20 D

21 C

22 C

23 D

24 C

25 A

Loading [MathJax]/jax/output/HTML-CSS/jax.js

You might also like