Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

local vs static variable in JSP

User_19BPUAug 2 2012 — edited Aug 2 2012
Hi,

The below is a local variable :-
<%
int foo = 0;
%>

which is equivalent to initializing the variable with in the jspInit().
--------
the below become the class member variable
<%!
int foo = 0;
%>

Which is equivalent to declaring outside the jspInit()? Please clarify.

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 30 2012
Added on Aug 2 2012
3 comments
2,906 views