Which JSP code snippet must you use to declare this instance variable in the JSP Document?

For manageability purposes, you have been told to add a “count” instance variable to a critical
JSP Document so that a JMX MBean can track how frequent this JSP is being invoked. Which
JSP code snippet must you use to declare this instance variable in the JSP Document?

For manageability purposes, you have been told to add a “count” instance variable to a critical
JSP Document so that a JMX MBean can track how frequent this JSP is being invoked. Which
JSP code snippet must you use to declare this instance variable in the JSP Document?

A.
<jsp:declaration>
int count = 0;
<jsp:declaration>

B.
<%! int count = 0; %>

C.
<jsp:declaration.instance>
int count = 0;
<jsp:declaration.instance>

D.
<jsp:scriptlet.declaration>
int count = 0;
<jsp:scriptlet.declaration>

Explanation:



Leave a Reply 2

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


fede

fede

why not B ?

fede

fede

ah ok, it’s “JSP Document” style